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

Method SetBuffer

src/AudioResampler.cpp:60–72  ·  view source on GitHub ↗

Sets the audio buffer and updates the key settings

Source from the content-addressed store, hash-verified

58
59// Sets the audio buffer and updates the key settings
60void AudioResampler::SetBuffer(juce::AudioBuffer<float> *new_buffer, double sample_rate, double new_sample_rate)
61{
62 if (sample_rate <= 0)
63 sample_rate = 44100;
64 if (new_sample_rate <= 0)
65 new_sample_rate = 44100;
66
67 // Set the sample ratio (the ratio of sample rate change)
68 source_ratio = sample_rate / new_sample_rate;
69
70 // Call SetBuffer with ratio
71 SetBuffer(new_buffer, source_ratio);
72}
73
74// Sets the audio buffer and key settings
75void AudioResampler::SetBuffer(juce::AudioBuffer<float> *new_buffer, double ratio)

Callers 1

apply_timemappingMethod · 0.80

Calls 2

setBufferMethod · 0.80
prepareToPlayMethod · 0.45

Tested by

no test coverage detected