Copyright © 2005-2019 MultiMedia Soft

SoundGenerator.StreamCreateDtmfString method

Previous pageReturn to chapter overviewNext page

Remarks

 

Creates a DTMF (Dual Tone Multi Frequency) tones audio stream and loads it inside the given player.

 

Once created, the audio stream can be played through the PlaySound method, paused through the PauseSound method and stopped through the StopSound method. Once no more needed, the audio stream can be discarded from memory through the CloseSound 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 StreamCreateDtmfString (

nPlayerIndex as Int16,

nSampleRate as Int32,

bMono as bool,

strDtmf as String,

nToneDurationMs as Int32,

nSilenceDurationMs as Int32,

nFadeInMs as Int32,

nFadeOutMs as Int32,

fAmplitude as Single

) as enumErrorCodes


 

[C#]

public enumErrorCodes StreamCreateDtmfString (

Int16 nPlayerIndex,

Int32 nSampleRate,

bool bMono,

string strDtmf,

Int32 nToneDurationMs,

Int32 nSilenceDurationMs,

Int32 nFadeInMs,

Int32 nFadeOutMs,

float fAmplitude

);


 

[C++]

public: enumErrorCodes StreamCreateDtmfString (

Int16 nPlayerIndex,

Int32 nSampleRate,

bool bMono,

string strDtmf,

Int32 nToneDurationMs,

Int32 nSilenceDurationMs,

Int32 nFadeInMs,

Int32 nFadeOutMs,

float fAmplitude

);


 

Parameter

Description

 

 

nPlayerIndex

Number representing the zero-based index of the involved player

nSampleRate

Sample rate of the stream, e.g. 44100

bMono

Boolean value specifying if the audio stream is in mono or stereo.

Supported values are the following:

Mnemonic Value

Meaning

false

Creates a stereo audio stream

true

Creates a mono audio stream

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

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

 

 

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.