JUCE  v5.1.1-3-g1a0b28c73
JUCE API
ToneGeneratorAudioSource Class Reference

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

#include <juce_ToneGeneratorAudioSource.h>

Inheritance diagram for ToneGeneratorAudioSource:
Collaboration diagram for ToneGeneratorAudioSource:

Public Member Functions

 ToneGeneratorAudioSource ()
 Creates a ToneGeneratorAudioSource. More...
 
 ~ToneGeneratorAudioSource ()
 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.

Constructor & Destructor Documentation

◆ ToneGeneratorAudioSource()

ToneGeneratorAudioSource::ToneGeneratorAudioSource ( )

◆ ~ToneGeneratorAudioSource()

ToneGeneratorAudioSource::~ToneGeneratorAudioSource ( )

Destructor.

Member Function Documentation

◆ getNextAudioBlock()

void ToneGeneratorAudioSource::getNextAudioBlock ( const AudioSourceChannelInfo )
overridevirtual

Implementation of the AudioSource method.

Implements AudioSource.

◆ prepareToPlay()

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

Implementation of the AudioSource method.

Implements AudioSource.

◆ releaseResources()

void ToneGeneratorAudioSource::releaseResources ( )
overridevirtual

Implementation of the AudioSource method.

Implements AudioSource.

◆ setAmplitude()

void ToneGeneratorAudioSource::setAmplitude ( float  newAmplitude)

Sets the signal's amplitude.

◆ setFrequency()

void ToneGeneratorAudioSource::setFrequency ( double  newFrequencyHz)

Sets the signal's frequency.

Member Data Documentation

◆ amplitude

float ToneGeneratorAudioSource::amplitude
private

◆ currentPhase

double ToneGeneratorAudioSource::currentPhase
private

◆ frequency

double ToneGeneratorAudioSource::frequency
private

◆ phasePerSample

double ToneGeneratorAudioSource::phasePerSample
private

◆ sampleRate

double ToneGeneratorAudioSource::sampleRate
private

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