Get magnitude of range of samples (if channel is -1, return average of all channels for that sample)
| 299 | |
| 300 | // Get magnitude of range of samples (if channel is -1, return average of all channels for that sample) |
| 301 | float Frame::GetAudioSample(int channel, int sample, int magnitude_range) |
| 302 | { |
| 303 | if (channel > 0) { |
| 304 | // return average magnitude for a specific channel/sample range |
| 305 | return audio->getMagnitude(channel, sample, magnitude_range); |
| 306 | |
| 307 | } else { |
| 308 | // Return average magnitude for all channels |
| 309 | return audio->getMagnitude(sample, magnitude_range); |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | // Get an array of sample data (and optional reverse the sample values) |
| 314 | float* Frame::GetAudioSamples(int channel) { |