Copyright © 2005-2018 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]

Public Function FileDataGet (

pBuffer() as Byte,

nBufferLen as Int32,

nDataType as enumDataTypes,

ByRef nBytesRead as Int32

) as Int32


 

[C#]

public Int32 FileDataGet (

byte[] pBuffer,

Int32 nBufferLen,

enumDataTypes nDataType,

ref Int32 nBytesRead

);


 

[C++]

public: Int32 FileDataGet (

unsigned char __gc[] pBuffer,

Int32 nBufferLen,

enumDataTypes nDataType,

Int32 __gc *nBytesRead

);


 

 

Parameter

Description

 

 

pBuffer

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.