Copyright © 2011-2018 MultiMedia Soft

SoundComposer.ItemDurationGet method

Previous pageReturn to chapter overviewNext page



Obtains the duration of the audio stream that will reproduce the item. For noises, wave tones and sliding wave tones, the duration can be modified through the SoundComposer.ItemDurationSet method.


For sound file items, added through one between the SoundComposer.ItemSoundFileAdd, SoundComposer.ItemSoundFileMemoryAdd, SoundComposer.ItemSoundFileRawAdd and SoundComposer.ItemSoundFileMemoryRawAdd methods, this method will always return the original duration of the sound file without keeping count of eventual modifications performed through the SoundComposer.ItemSoundFileLoadRangeSet or SoundComposer.ItemSoundFileDurationStretch methods: for these specific changes you could know the modified duration through the SoundComposer.ItemSoundFileDurationGet.


For further details about sound composing see the the SoundComposerMan class and the How to compose a sound tutorial.





[Visual Basic]

Public Function ItemDurationGet (

nUniqueId as Int32,

ByRef nDuration as Int32

) as enumErrorCodes



public enumErrorCodes ItemDurationGet (

Int32 nUniqueId,

ref Int32 nDuration




public: enumErrorCodes ItemDurationGet (

Int32 nUniqueId,

Int32 __gc *nDuration








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

- SoundComposer.ItemDtmfStringAdd for DTMF items.

- SoundComposer.ItemNoiseAdd for noise tone items.

- SoundComposer.ItemSlidingWaveToneAdd for sliding wave tone items.

- SoundComposer.ItemSoundFileAdd, SoundComposer.ItemSoundFileMemoryAdd, SoundComposer.ItemSoundFileRawAdd, SoundComposer.ItemSoundFileMemoryRawAdd, SoundComposer.ItemSoundFileFromEditorAdd,and SoundComposer.ItemSoundFileFromRecorderAdd for sound file items

- SoundComposer.ItemWaveToneAdd for wave tone items.

- SoundComposer.ItemSpeechFromStringAdd and SoundComposer.ItemSpeechFromFileAdd for text to speech items.


Reference that, on return from the method call, will contain the duration of the item expressed in milliseconds.



Return value






Negative value

An error occurred (see the LastError property for further error details)

enumErrorCodes.NOERROR (0)

The method call was successful.