Copyright © 2008-2023 MultiMedia Soft

SoundGenerator.CompositeWaveToneAddNewWaveTone method

Previous pageReturn to chapter overviewNext page

Remarks

 

Adds a single wave tone to a composite audio stream previously created through a previous call to the SoundGenerator.CompositeWaveTonePrepare method.

 

For further details about sound generation see the SoundGeneratorMan class and the How to generate wave tones, noises, DTMF tones and text to speech tutorial.

 

 

Syntax

 

[Visual Basic]

Public Function CompositeWaveToneAddNewWaveTone (

nWaveType as enumSoundGenWaveTypes,

fFrequency as Single,

fAmplitude as Single,

nDurationMs as Int32,

nOffsetMs as Int32,

nChannel as Int32,

) as enumErrorCodes


 

[C#]

public enumErrorCodes CompositeWaveToneAddNewWaveTone (

enumSoundGenWaveTypes nWaveType,

float fFrequency,

float fAmplitude,

Int32 nDurationMs,

Int32 nOffsetMs,

Int32 nChannel

);


 

[C++]

public: enumErrorCodes CompositeWaveToneAddNewWaveTone (

enumSoundGenWaveTypes nWaveType,

float fFrequency,

float fAmplitude,

Int32 nDurationMs,

Int32 nOffsetMs,

Int32 nChannels

);


 

Parameter

Description

 

 

nWaveType

Type of wave tone.

Supported values are the following:

Mnemonic Value

Value

Meaning

SOUNDGEN_WAVE_TYPE_SINE

0

Sine wave

SOUNDGEN_WAVE_TYPE_SQUARE

1

Square wave

SOUNDGEN_WAVE_TYPE_SAWTOOTH

2

Sawtooth wave

SOUNDGEN_WAVE_TYPE_SAWTOOTH_NEGATIVE

3

Negative sawtooth wave

SOUNDGEN_WAVE_TYPE_TRIANGLE

4

Triangle wave

fFrequency

Wave tone frequency expressed in Hertz

fAmplitude

Wave tone amplitude.

- value 0.0 means that sound volume is muted

- values higher than 0.0 and lower than 1.0 attenuate the sound volume

- value 1.0 sets the sound at full volume

- values higher than 1.0 amplify the sound volume

nDurationMs

Duration of the wave tone expressed in milliseconds.

nOffsetMs

Offset of the wave tone, expressed in milliseconds, respect to the beginning of the audio stream.

nChannel

Destination channel of the audio stream, created through a previous call to the SoundGenerator.CompositeWaveTonePrepare method, were the wave tone will be placed. Set this parameter to -1 for adding the wave tone to all of the available channels.

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred (see the LastError property for further error details)

enumErrorCodes.NOERROR (0)

The method call was successful.