65 if (phasePerSample == 0.0)
68 for (
int i = 0; i <
info.numSamples; ++i)
70 const float sample = amplitude * (
float) std::sin (currentPhase);
71 currentPhase += phasePerSample;
73 for (
int j =
info.buffer->getNumChannels(); --
j >= 0;)
Holds a resizable array of primitive or copy-by-value objects.
void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override
Implementation of the AudioSource method.
void releaseResources() override
Implementation of the AudioSource method.
void setFrequency(double newFrequencyHz)
Sets the signal's frequency.
ToneGeneratorAudioSource()
Creates a ToneGeneratorAudioSource.
void getNextAudioBlock(const AudioSourceChannelInfo &) override
Implementation of the AudioSource method.
void setAmplitude(float newAmplitude)
Sets the signal's amplitude.
~ToneGeneratorAudioSource() override
Destructor.
Used by AudioSource::getNextAudioBlock().
Commonly used mathematical constants.