Copyright © 2005-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]

Public Function StreamChannelAddDtmfString (

nPlayerIndex as Int16,

nChannel as Int16,

strDtmf as String,

nToneDurationMs as Int32,

nSilenceDurationMs as Int32,

nOffsetMs as Int32,

nFadeInMs as Int32,

nFadeOutMs as Int32,

fAmplitude as Single,

ByRef nUniqueId as Int32

) as enumErrorCodes


 

[C#]

public enumErrorCodes StreamChannelAddDtmfString (

Int16 nPlayerIndex,

Int16 nChannel,

string strDtmf,

Int32 nToneDurationMs,

Int32 nSilenceDurationMs,

Int32 nOffsetMs,

Int32 nFadeInMs,

Int32 nFadeOutMs,

float fAmplitude,

ref Int32 nUniqueId

);


 

[C++]

public: enumErrorCodes StreamChannelAddDtmfString (

Int16 nPlayerIndex,

Int16 nChannel,

string strDtmf,

Int32 nToneDurationMs,

Int32 nSilenceDurationMs,

Int32 nOffsetMs,

Int32 nFadeInMs,

Int32 nFadeOutMs,

float fAmplitude,

Int32 __gc  *nUniqueId

);


 

Parameter

Description

 

 

nPlayerIndex

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 (see the LastError property for further error details)

enumErrorCodes.NOERROR (0)

The method call was successful.