Copyright © 2008-2018 MultiMedia Soft

ExportChannelsToFile method

Previous pageReturn to chapter overviewNext page

Remarks

 

Requests to export the given sound portion from a specific channel of a multi-channel sound file into a destination mono or stereo sound file using the sound encoding format defined inside the EncodeFormats.FormatToUse property.

An exporting session can be stopped at any time through a call to the ExportSoundCancel method.

 

A successful call to this method will fire the SoundExportStarted event followed by a number of SoundExportPerc events and finally by the SoundExportDone event.

 

For further details see the How to export edited sounds tutorial.

 

 

Syntax

 

[Visual Basic]

control.ExportChannelsToFile (

nFirstChannel as Integer,

bStereoOut as enumBoolean,

nStartPosition as Long,

nEndPosition as Long,

strPathname as String

) as enumErrorCodes


 

[C++]

short control.ExportChannelsToFile (

short nFirstChannel,

short bStereoOut,

long nStartPosition,

long nEndPosition,

LPCTSTR strPathname

);


 

 

Parameter

Description

 

 

nFirstChannel

First zero-based mono channel to export from the loaded multi-channel sound file.

bStereoOut

Boolean flag determining if the output file will be stereo: in this case both nFirstChannel and nFirstChannel+1 will be exported.

Supported values are the following:

Mnemonic Value

Meaning

BOOL_FALSE

Only the mono channel defined by the nFirstChannel parameter is exported into the destination file that will result in a mono audio file.

BOOL_TRUE

Both mono channels defined by the nFirstChannel parameter and nFirstChannel+1 will be exported into the destination file that will result in a stereo audio file.

For example, in case the loaded sound should be in 5.1 format (6 channels), you could export the first and second channels by setting the nFirstChannel parameter to 0 and the third and fourth channels by setting the nFirstChannel parameter to 2.

nStartPosition

Start position, expressed in milliseconds, of the sound range to export

nEndPosition

End position, expressed in milliseconds, of the sound range to export. If set to -1 the end position will be set to the end of the sound.

strPathname

String containing the absolute pathname of the destination file. If this pathname should contain invalid characters, they would be automatically changed into an underscore '_' character.

 

 

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.