Copyright © 2008-2018 MultiMedia Soft

SoundComposer.ItemDurationSet method

Previous pageReturn to chapter overviewNext page



Modifies the duration of the audio stream that will reproduce the item. The current duration can be obtained through the SoundComposer.ItemDurationGet method.


This method doesn't work for:

DTMF tones because the duration of the item strictly depends upon the number of characters inside the string itself and upon the duration of each single tone and of the silence between tones.
Text to speech because the duration of the item strictly depends upon the number of words and upon the presence of eventual XML markups.
Sound files: there is the possibility to reduce the loaded range through the the SoundComposer.ItemSoundFileLoadRangeSet method or to stretch the original duration through the SoundComposer.ItemSoundFileDurationStretch method.


For further details about sound composing see the the SoundComposer object and the How to compose a sound tutorial.





[Visual Basic]

control.SoundComposer.ItemDurationSet (

nUniqueId as Long,

nDuration as Long

) as enumErrorCodes



short control.SoundComposer.ItemDurationSet (

long nUniqueId,

long nDuration








The unique identifier of the element previously returned by the call to one of the following methods:

- SoundComposer.ItemNoiseAdd for noise tone items.

- SoundComposer.ItemSlidingWaveToneAdd for sliding wave tone items.

- SoundComposer.ItemWaveToneAdd for wave tone items.


Duration of the item expressed in milliseconds.



Return value






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