Fixed a race condition in video playback thread! Also, added new method to get the average magnitude of a range of audio samples.

This commit is contained in:
Jonathan Thomas
2016-04-22 02:43:06 -05:00
parent 179d091005
commit 37f1894300
4 changed files with 23 additions and 10 deletions

View File

@@ -296,6 +296,19 @@ void Frame::DisplayWaveform()
ClearWaveform();
}
// Get magnitude of range of samples (if channel is -1, return average of all channels for that sample)
float Frame::GetAudioSample(int channel, int sample, int magnitude_range)
{
if (channel > 0) {
// return average magnitude for a specific channel/sample range
return audio->getMagnitude(channel, sample, magnitude_range);
} else {
// Return average magnitude for all channels
return audio->getMagnitude(sample, magnitude_range);
}
}
// Get an array of sample data
float* Frame::GetAudioSamples(int channel)
{