OpenShot Library | libopenshot-audio
0.2.0
|
42 amplitude = newAmplitude;
47 frequency = newFrequencyHz;
65 if (phasePerSample == 0.0)
70 const float sample = amplitude * (float) std::sin (currentPhase);
71 currentPhase += phasePerSample;
void getNextAudioBlock(const AudioSourceChannelInfo &) override
Implementation of the AudioSource method.
ToneGeneratorAudioSource()
Creates a ToneGeneratorAudioSource.
Commonly used mathematical constants.
~ToneGeneratorAudioSource() override
Destructor.
void setSample(int destChannel, int destSample, Type newValue) noexcept
Sets a sample in the buffer.
void setAmplitude(float newAmplitude)
Sets the signal's amplitude.
int startSample
The first sample in the buffer from which the callback is expected to write data.
int numSamples
The number of samples in the buffer which the callback is expected to fill with data.
void setFrequency(double newFrequencyHz)
Sets the signal's frequency.
void releaseResources() override
Implementation of the AudioSource method.
int getNumChannels() const noexcept
Returns the number of channels of audio data that this buffer contains.
AudioBuffer< float > * buffer
The destination buffer to fill with audio data.
Used by AudioSource::getNextAudioBlock().
void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override
Implementation of the AudioSource method.