Copyright © 2001-2019 MultiMedia Soft

SoundGenerator.StreamChannelAddDtmfString method

Previous pageReturn to chapter overviewNext page

Remarks

 

Adds a DTMF (Dual Tone Multi Frequency) tones generator element to the audio stream previously created through the SoundGenerator.StreamCreateMultiChannelEmpty method.

 

When the rendering of the DTMF tones has been completed, the element itself is automatically removed from the the audio stream; if you need to create a DTMF tones generator that could be reproduced again after its complete rendering, use the SoundGenerator.StreamCreateDtmfString 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.StreamChannelAddDtmfString (

nPlayer as Integer,

nChannel as Integer,

strDtmf as String,

nToneDurationMs as Long,

nSilenceDurationMs as Long,

nOffsetMs as Long,

nFadeInMs as Long,

nFadeOutMs as Long,

fAmplitude as Single,

ByRef nUniqueId as Long

) as enumErrorCodes


 

[C++]

short control.SoundGenerator.StreamChannelAddDtmfString (

short nPlayer,

short nChannel,

LPCTSTR strDtmf,

long nToneDurationMs,

long nSilenceDurationMs,

long nOffsetMs,

long nFadeInMs,

long nFadeOutMs,

float fAmplitude,

long *nUniqueId

);


 

Parameter

Description

 

 

nPlayer

Number representing the zero-based index of the involved player

nChannel

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

strDtmf

String containing DTMF characters that will dial the phone number

nToneDurationMs

Duration of each DTMF tone expressed in milliseconds

nSilenceDurationMs

Duration of silence between each DTMF tone expressed in milliseconds

nOffsetMs

Offset of the DTMF tones, expressed in milliseconds, respect to the beginning of the audio stream.

nFadeInMs

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

nFadeOutMs

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

fAmplitude

Amplitude of DTMF tones.

- value 0.0 means that DTMF tones are muted

- values higher than 0.0 and smaller than 1.0 attenuate DTMF tones

- value 1.0 sets DTMF tones at full volume

- values higher than 1.0 amplify DTMF tones

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.StreamElementAmplitudeSet and SoundGenerator.StreamElementAmplitudeGet to modify and retrieve the amplitude of the DTMF element.

- SoundGenerator.StreamElementDtmfStringGet to obtain the current string of DTMF characters.

- SoundGenerator.StreamElementRemove to remove the DTMF element from the audio stream.

- SoundGenerator.StreamElementOffsetGet to obtain the offset of the DTMF 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