Copyright © 2001-2019 MultiMedia Soft

MediaFileDecoder.FileDataGet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Reads a chunk of sound data from the decoded media file into a memory buffer. Each call to this method will automatically increment the position internal to the decoded file allowing to read the full audio track without the need to reposition the reader.

 

For details about management of media files decoding, refer to the How to decode media files tutorial.

 

 

Syntax

 

[Visual Basic]

control.MediaFileDecoder.FileDataGet (

pBuffer as Variant,

nBufferLen as Long,

nDataType as enumDataTypes,

nBytesRead as Long

) as enumErrorCodes


 

[C++]

short control.MediaFileDecoder.FileDataGet (

const VARIANT FAR& pBuffer,

long nBufferLen,

short nDataType,

long *nBytesRead

);


 

Parameter

Description

 

 

pBuffer

Variant variable containing the pointer to the buffer to receive the data

nBufferLen

Length in bytes of the given buffer

nDataType

Establishes how data read should be returned.

Supported values are the following:

Mnemonic constant

Value

Meaning

DATA_TYPE_NATIVE

0

Sound data is read using the same bits per sample of the decoded file.

DATA_TYPE_FLOAT

1

Sound data is read in floating point.

nBytesRead

Reference that, on return from the method call, will contain the number of bytes effectively read.

This parameter will usually return the same number of bytes set into the nBufferLen parameter: if the returned value should be smaller than the nBufferLen parameter or should be 0, this would mean that the end of the audio track has been reached.

 

 

Return value

 

Value

Meaning

 

 

enumErrorCodes.NOERROR (0)

The method call successful.

Negative value

An error occurred: see the LastError property for further error details or for a list of the possible error values.