class ToneGenerator

Defined at line 13 of file ../../src/media/audio/examples/tones/tone_generator.h

Generates a single channel of tone in FLOAT format.

Public Methods

void ToneGenerator (uint32_t frames_per_second, float frequency, float volume, float decay)

Constructs a tone generator that produces a tone at |frequency| hertz.

A |volume| values in excess of 1.0 are likely to produce distortion.

|decay| specifies the factor by which volume should be reduced in one

second. A |decay| value of 0.0 produces a constant tone. A |decay| value

of 0.9 reducees the volume 90% (to 10%) in one second.

Defined at line 11 of file ../../src/media/audio/examples/tones/tone_generator.cc

void MixSamples (float * dest, uint32_t frame_count, uint32_t channel_count)

Mixes |frame_count| samples into |dest|, summing the first sample into

|*dest|, the next into |*(dest + channel_count)|, etc. |channel_count| is

used for stride only. Only one channel of audio is generated.

Defined at line 19 of file ../../src/media/audio/examples/tones/tone_generator.cc

float volume ()

Returns the volume, subject to decay.

Defined at line 28 of file ../../src/media/audio/examples/tones/tone_generator.h