SoundComposer.ItemSoundFileAdd method |
|
Remarks
Adds a sound file, or a given range within the sound file, to the audio stream previously created through the SoundComposer.SessionCreate method. Supported sound file formats are the same mentioned inside the LoadSound method.
In case the sound file should be stored inside a memory buffer, use the SoundComposer.ItemSoundFileMemoryAdd method.
In case the sound file should be in a RAW format, use the SoundComposer.ItemSoundFileRawAdd or SoundComposer.ItemSoundFileMemoryRawAdd methods.
For further details about sound composing see the the SoundComposer object and the How to compose a sound tutorial.
Syntax
[Visual Basic] short control.SoundGenerator.ItemSoundFileAdd ( nPlayer as Integer, strFriendlyName as String, nChannel as Integer, strPathname as String, bDownMixToMonoe as enumBoolean, nOffsetMs as Long, nStartPositionMs as Long, nEndPositionMs as Long, ByRef nUniqueId as Long ) as enumErrorCodes |
[C++] short control.SoundGenerator.ItemSoundFileAdd ( short nPlayer, LPCTSTR strFriendlyName, short nChannel, LPCTSTR strPathname, short bDownMixToMono, long nOffsetMs, long nStartPositionMs, long nEndPositionMs, long *nUniqueId ); |
Parameter |
Description |
||||||||||||
|
|
||||||||||||
nPlayer |
Number representing the zero-based index of the player that owns the sound composer session |
||||||||||||
nChannel |
Mono channel or stereo channel pair of the audio stream that will reproduce the item. This parameter is ignored when the sound file is added in "append mode" after a previous call to the SoundComposer.ItemAppendNext method.
Due to the fact that the audio stream previously created through the SoundComposer.SessionCreate method could be multi-channel, this would be the behaviour when a sound file item is added:
(*) If for example the audio stream previously created through the SoundComposer.SessionCreate method should have 8 channels (7.1 multi-channel), stereo channels pairs would be mapped as follows: - stereo channel pair 0 would group mono channels 0 and 1 - stereo channel pair 1 would group mono channels 2 and 3 - stereo channel pair 2 would group mono channels 4 and 5 - stereo channel pair 3 would group mono channels 6 and 7 |
||||||||||||
strPathname |
Absolute pathname of the sound file |
||||||||||||
bDownMixToMono |
Boolean flag specifying if there is the need of a downmix in order to store a stereo sound file into a mono channel of the stream. Supported values are the following:
This parameter is ignored when the sound file is added in "append mode" after a previous call to the SoundComposer.ItemAppendNext method. |
||||||||||||
nOffsetMs |
Offset of the item, expressed in milliseconds, respect to the beginning of the audio stream (in case the stream should be in stopped state) or respect to the current playback position (in case the stream should be already in playback state). This parameter is ignored when the sound file is added in "append mode" after a previous call to the SoundComposer.ItemAppendNext method. |
||||||||||||
nStartPositionMs |
The start position, expressed in milliseconds, where the sound file loading will occur. Set this value to 0 for loading from the beginning of the sound. |
||||||||||||
nEndPositionMs |
The end position, expressed in milliseconds, where the sound file loading will occur. Set this value to -1 for loading till the sound end. |
||||||||||||
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:
- SoundComposer.ItemFriendlyNameGet to obtain the friendly name of the item - SoundComposer.ItemFriendlyNameSet to obtain the friendly name of the item - SoundComposer.ItemContentGet to obtain contents of the item - SoundComposer.ItemInfoGet to obtain various information about the item - SoundComposer.ItemAmplitudeSet to modify the amplitude of the item - SoundComposer.ItemChannelSet to modify the channel of of the audio stream that will reproduce the item - SoundComposer.ItemRemove to remove the item from the sound composition - SoundComposer.ItemOffsetSet to modify the offset, expressed in milliseconds, of the item respect to the beginning of the audio stream - SoundComposer.ItemTypeGet to obtain the item's type |
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. |