Copyright © 2001-2018 MultiMedia Soft

SoundGenerator.StreamChannelAddSlidingTone method

Previous pageReturn to chapter overviewNext page

Remarks

 

Adds a sliding wave tone element to the audio stream previously created through the SoundGenerator.StreamCreateMultiChannelEmpty method.

 

When the rendering of the sliding wave tone has been completed, the element itself is automatically removed from the the audio stream; if you need to create a sliding wave tone that could be reproduced again after its complete rendering, use the SoundGenerator.StreamCreateSlidingTone method.

 

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

 

 

Syntax

 

[Visual Basic]

control.SoundGenerator.StreamChannelAddSlidingTone (

nPlayer as Integer,

nChannel as Integer,

nWaveType as enumSoundGenSlidingWaveTypes,

fFrequencyStart as Single,

fFrequencyEnd as Single,

fAmplitudeStart as Single,

fAmplitudeEnd as Single,

bLogInterpolation as enumBoolean,

nDurationMs as Long,

nOffsetMs as Long,

nFadeInMs as Long,

nFadeOutMs as Long,

ByRef nUniqueId as Long

) as enumErrorCodes


 

[C++]

short control.SoundGenerator.StreamChannelAddSlidingTone (

short nPlayer,

short nChannel,

short nWaveType,

float fFrequencyStart,

float fFrequencyEnd,

float fAmplitudeStart,

float fAmplitudeEnd,

short bLogInterpolation,

long nDurationMs,

long nOffsetMs,

long nFadeInMs,

long nFadeOutMs,

long *nUniqueId

);


 

Parameter

Description

 

 

nPlayer

Number representing the zero-based index of the involved player

nChannel

Channel of the audio stream that will reproduce the sliding wave tone: can be a value between 0 and the number of channels of the audio stream created through the SoundGenerator.StreamCreateMultiChannelEmpty method.

nWaveType

Type of wave tone.

Supported values are the following:

Mnemonic Value

Value

Meaning

SOUNDGEN_SLIDING_WAVE_TYPE_SINE

0

Sine wave

SOUNDGEN_SLIDING_WAVE_TYPE_SQUARE

1

Square wave

SOUNDGEN_SLIDING_WAVE_TYPE_SAWTOOTH

2

Sawtooth wave

SOUNDGEN_SLIDING_WAVE_TYPE_SQUARE_NO_ALIAS

3

Square wave without aliasing

fFrequencyStart

Initial wave tone frequency expressed in Hertz, e.g. 700

fFrequencyEnd

Final wave tone frequency expressed in Hertz, e.g. 1000

fAmplitudeStart

Initial wave tone amplitude.

- value 0.0 means that sound volume is muted

- values higher than 0.0 and smaller than 1.0 attenuates the sound volume

- value 1.0 sets the sound at full volume

- values higher than 1.0 amplifies the sound volume

fAmplitudeEnd

Final wave tone amplitude.

- value 0.0 means that sound volume is muted

- values higher than 0.0 and smaller 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

bLogInterpolation

Boolean value indicating if the sliding should use linear or logarithmic interpolation.

Supported values are the following:

Mnemonic Value

Meaning

BOOL_FALSE

Uses linear interpolation

BOOL_TRUE

Uses logarithmic interpolation

nDurationMs

Duration of the wave tone expressed in milliseconds

nOffsetMs

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

nFadeInMs

Duration of the fade-in at the beginning of the tone expressed in milliseconds. Set this value to 0 if you don't need to apply a fade-in at the beginning of the audio stream.

nFadeOutMs

Duration of the fade-out at the end of the tone expressed in milliseconds. Set this value to 0 if you don't need to apply a fade-out at the end of the audio stream.

nUniqueId

Reference to a value that, on return from the method call, will contain the unique identifier of the newly added element: this unique identifier will be used in order to invoke further methods related to the use of this specific element.

- SoundGenerator.StreamElementSlidingToneLimitsGet to retrieve frequencies and amplitudes used to render the sliding wave tone element.

- SoundGenerator.StreamElementSlidingToneTypeGet to obtain the type of sliding wave tone.

- SoundGenerator.StreamElementRemove to remove the wave tone element from the audio stream.

- SoundGenerator.StreamElementDurationGet to obtain the duration of the wave tone element.

- SoundGenerator.StreamElementOffsetGet to obtain the offset of the wave tone element.

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred, check the LastError property value in order to get the error code

enumErrorCodes.ERR_NOERROR (0)

The method call was successful