Added some new methods to access audio data: channels, samples, etc... Also, added initial unit tests for the FFmpegReader class, including waveform checking against an actual audio file.

This commit is contained in:
Jonathan Thomas
2012-07-09 01:22:11 -05:00
parent 0c2008461a
commit 3b46aad2ef
4 changed files with 65 additions and 0 deletions

View File

@@ -243,6 +243,25 @@ void Frame::DisplayWaveform(bool resize)
wave_image.display();
}
// Get an array of sample data
float* Frame::GetAudioSamples(int channel)
{
// return JUCE audio data for this channel
return audio->getSampleData(channel);
}
// Get number of audio channels
int Frame::GetAudioChannelsCount()
{
return audio->getNumChannels();
}
// Get number of audio samples
int Frame::GetAudioSamplesCount()
{
return audio->getNumSamples();
}
// Get pixel data (as packets)
const Magick::PixelPacket* Frame::GetPixels()
{