MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / GetAudioSample

Method GetAudioSample

src/Frame.cpp:301–311  ·  view source on GitHub ↗

Get magnitude of range of samples (if channel is -1, return average of all channels for that sample)

Source from the content-addressed store, hash-verified

299
300// Get magnitude of range of samples (if channel is -1, return average of all channels for that sample)
301float 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)
314float* Frame::GetAudioSamples(int channel) {

Callers 1

FrameMapper.cppFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected