MixAutomationItemAddFromFile method |
|
Remarks
Adds a sound file, or a portion of sound file, taken from a given pathname to the mixing automation list.
Accepted stream formats are: MP1, MP2, MP3, MP4 (***), AIFF, AAC, M4A, AC3, FLAC, WavPack, ALAC, WAV, OGG Vorbis, OPUS, WMA (*), ASF (**), WMV (**), W64, AU, PAF, SVX, NIST, VOC, IRCAM, PVF, CAF, Speex, Musepack, Monkey's Audio (APE), MIDI.
Formats wrapped inside a RIFF container (for example GSM 6.10, ADPCM, CCITT, etc. ) are supported if the specific ACM (Audio Compression Manager) codec is installed inside the system.
Multi-channel WAV, AIFF, OGG Vorbis, OPUS and WMA formats are not supported and will be resampled and converted to stereo during the loading procedure.
For adding files in RAW format use the MixAutomationItemAddFromFileRaw method.
For further information about management of append automation sessions refer to the How to mix or append several sounds in one single shot tutorial.
Syntax
[Visual Basic] control.MixAutomationItemAddFromFile ( strPathname as String, nStartPosition as Long, nEndPosition as Long, fVolume as Single, nMixPosition as Long ) as enumErrorCodes |
[C++] short control.MixAutomationItemAddFromFile ( LPCTSTR strPathname, long nStartPosition, long nEndPosition, float fVolume, long nMixPosition ); |
Parameter |
Description |
|
|
strPathname |
String representing the absolute pathname of the source sound file. |
nStartPosition |
Start position, expressed in milliseconds, of the range to load from the added sound file |
nEndPosition |
End position, expressed in milliseconds, of the range to load from the added sound file |
fVolume |
Volume level applied to the added song when it will be mixed to the destination sound. Supported values are expressed with a linear volume in the range from 0 to 100. In case you should need to set a volume expressed in dB, before setting this parameter you could convert the value in dB into a linear value through the following formula (C syntax): VolumeLinear = 100 * pow (10, VolumeInDB/20); |
nMixPosition |
Position, expressed in milliseconds, inside the destination sound where the added file will be mixed |
Return value
Value |
Meaning |
|
|
Negative value |
An error occurred, check the LastError property value in order to see the error code meaning |
enumErrorCodes.ERR_NOERROR (0) |
The method call was successful. |
(*) Requires Microsoft Windows Media Format modules already installed on the target PC: you can verify the presence of these modules through a call to the IsWmaAvailable method.
(**) Performs only sound tracks (no video): requires Microsoft Windows Media Format modules already installed on the target PC
(***) Performs only sound frames (no video)
The Windows Media Format modules can be installed using the redistribution setup package (wmfdist.exe) provided by Microsoft. Details about the integration of these modules inside your own setup package can be found on the following link of the official Microsoft web site (note that in the future this link could change due to the Microsoft site maintenance).