Copyright © 2008-2023 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]

Public Function ExportChannelsToFile (

nFirstChannel as Int32,

bStereoOut as Boolean,

nStartPosition as Int32,

nEndPosition as Int32,

strPathname as string

) as enumErrorCodes


 

[C#]

public enumErrorCodes ExportChannelsToFile (

Int32 nFirstChannel,

bool bStereoOut,

Int32 nStartPosition,

Int32 nEndPosition,

string strPathname

);


 

[C++]

public: enumErrorCodes ExportChannelsToFile (

Int32 nFirstChannel,

bool bStereoOut,

Int32 nStartPosition,

Int32 nEndPosition,

string 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

false

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

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 last error.

enumErrorCodes.ERR_NOERROR (0)

The method call was successful.