Copyright © 2011-2023 MultiMedia Soft

SoundGenerator.DtmfStringGenerate method

Previous pageReturn to chapter overviewNext page

Remarks

 

Generates and load into the editor a DTMF (Dual Tone Multi Frequency) audio stream.

 

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 DtmfStringGenerate (

strDtmf as String,

nSampleRate as Int32,

nChannels as Int32,

nToneDurationMs as Int32,

nSilenceDurationMs as Int32,

nFadeInMs as Int32,

nFadeOutMs as Int32,

fAmplitude as Single

) as enumErrorCodes


 

[C#]

public enumErrorCodes DtmfStringGenerate (

string strDtmf,

Int32 nSampleRate,

Int32 nChannels,

Int32 nToneDurationMs,

Int32 nSilenceDurationMs,

Int32 nFadeInMs,

Int32 nFadeOutMs,

float fAmplitude

);


 

[C++]

public: enumErrorCodes DtmfStringGenerate (

string strDtmf,

Int32 nSampleRate,

Int32 nChannels,

Int32 nToneDurationMs,

Int32 nSilenceDurationMs,

Int32 nFadeInMs,

Int32 nFadeOutMs,

float fAmplitude

);


 

Parameter

Description

 

 

strDtmf

String containing DTMF characters that will dial the phone number

nSampleRate

Sample rate of the stream, e.g. 44100

nChannels

Number of channels of the audio stream.

Supported values are the following:

Value

Meaning

1

Mono audio stream

2

Stereo audio stream

4

3.1 audio stream

6

5.1 audio stream

8

7.1 audio stream

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 lower 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.