JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::ToneGeneratorAudioSource Class Reference

A simple AudioSource that generates a sine wave. More...

#include <juce_ToneGeneratorAudioSource.h>

Inheritance diagram for juce::ToneGeneratorAudioSource:
Collaboration diagram for juce::ToneGeneratorAudioSource:

Public Member Functions

 ToneGeneratorAudioSource ()
 Creates a ToneGeneratorAudioSource. More...
 
 ~ToneGeneratorAudioSource () override
 Destructor. More...
 
void getNextAudioBlock (const AudioSourceChannelInfo &) override
 Implementation of the AudioSource method. More...
 
void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override
 Implementation of the AudioSource method. More...
 
void releaseResources () override
 Implementation of the AudioSource method. More...
 
void setAmplitude (float newAmplitude)
 Sets the signal's amplitude. More...
 
void setFrequency (double newFrequencyHz)
 Sets the signal's frequency. More...
 

Private Attributes

float amplitude
 
double currentPhase
 
double frequency
 
double phasePerSample
 
double sampleRate
 

Detailed Description

A simple AudioSource that generates a sine wave.

@tags{Audio}

Constructor & Destructor Documentation

◆ ToneGeneratorAudioSource()

juce::ToneGeneratorAudioSource::ToneGeneratorAudioSource ( )

◆ ~ToneGeneratorAudioSource()

juce::ToneGeneratorAudioSource::~ToneGeneratorAudioSource ( )
override

Destructor.

Member Function Documentation

◆ getNextAudioBlock()

void juce::ToneGeneratorAudioSource::getNextAudioBlock ( const AudioSourceChannelInfo )
overridevirtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

◆ prepareToPlay()

void juce::ToneGeneratorAudioSource::prepareToPlay ( int  samplesPerBlockExpected,
double  sampleRate 
)
overridevirtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

◆ releaseResources()

void juce::ToneGeneratorAudioSource::releaseResources ( )
overridevirtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

◆ setAmplitude()

void juce::ToneGeneratorAudioSource::setAmplitude ( float  newAmplitude)

Sets the signal's amplitude.

◆ setFrequency()

void juce::ToneGeneratorAudioSource::setFrequency ( double  newFrequencyHz)

Sets the signal's frequency.

Member Data Documentation

◆ amplitude

float juce::ToneGeneratorAudioSource::amplitude
private

◆ currentPhase

double juce::ToneGeneratorAudioSource::currentPhase
private

◆ frequency

double juce::ToneGeneratorAudioSource::frequency
private

◆ phasePerSample

double juce::ToneGeneratorAudioSource::phasePerSample
private

◆ sampleRate

double juce::ToneGeneratorAudioSource::sampleRate
private

The documentation for this class was generated from the following file: