Copyright © 2008-2018 MultiMedia Soft

AppendAutomationItemAddFromFile method

Previous pageReturn to chapter overviewNext page

Remarks

 

Adds a sound file, or a portion of sound file, taken from a given pathname to the append 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 conversion procedure.

 

For adding files in RAW format use the AppendAutomationItemAddFromFileRaw 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]

Public Function AppendAutomationItemAddFromFile (

strPathname as String,

nStartPosition as Int32,

nEndPosition as Int32,

fVolume as Single

) as enumErrorCodes


 

[C#]

public enumErrorCodes AppendAutomationItemAddFromFile (

string strPathname,

Int32 nStartPosition,

Int32 nEndPosition,

float fVolume

);


 

[C++]

public: enumErrorCodes AppendAutomationItemAddFromFile (

string strPathname,

Int32 nStartPosition,

Int32 nEndPosition,

float fVolume

);


 

 

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

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);

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred. Check the LastError property value in order to see the last error.

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