Copyright © 2011-2018 MultiMedia Soft

TagsEditor.WAV_BextChunkBinaryFieldGet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Obtains a copy in memory of a binary field stored inside the WAV Bext chunk. Current contents can be modified through the TagsEditor.WAV_BextChunkBinaryFieldSet method.

 

For further details about methods related to tags editing refer to the TagsEditorMan class.

For details about the editing of tags see the How to edit tag info in sound files tutorial.

 

 

Syntax

 

[Visual Basic]

Public Function WAV_BextChunkBinaryFieldGet (

nFieldId as enumBextChunkBinaryField,

pBuffer() as Byte,

ByRef nBufferLength as Int32

) as enumErrorCodes


 

[C#]

public string WAV_BextChunkBinaryFieldGet (

enumBextChunkBinaryField nFieldId,

byte[] pBuffer,

ref Int32 nBufferLength

);


 

[C++]

public: string WAV_BextChunkBinaryFieldGet (

enumBextChunkBinaryField nFieldId,

unsigned char __gc[] pBuffer,

Int32 __gc *nBufferLength

);


 

Parameter

Description

 

 

nFieldId

Identifier of the binary field to read.

Supported values are the following:

Mnemonic Value

Value

Meaning

WAV_BEXT_CHUNK_BIN_UMID_0

0

Binary bytes of SMPTE UMID

WAV_BEXT_CHUNK_BIN_Reserved

1

Reserved for future expansion

pBuffer

Output buffer that, on return from the method call, will contain binary data of the requested field.

nBufferLength

Reference that represents the maximum allowed size of the buffer (in input) and, on return from the method call, will contain the effective size of the buffer read; the value is expressed in bytes.

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred (see the LastError property for further error details)

enumErrorCodes.ERR_NOERROR (0)

The method call was successful.

 

 

Below you can find a couple of samples that demonstrate how to retrieve a picture and store it inside a memory buffer in Visual Basic.NET and Visual C#:

 

Visual Basic.NET

 

Private Sub buttonGetPicture_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles buttonGetPicture.Click

{

' get the size of the picture in bytes

Dim nSizeInBytes As Int32

AudioSoundEditor1.TagsEditor.FLAC_PictureFrameSizeGet (0, nSizeInBytes)

if nSizeInBytes = 0 then Exit Sub

 

' allocate the receiving buffer

Dim byteBuffer As Byte() = Nothing

byteBuffer = New Byte(nSizeInBytes)

 

' read picture data

AudioSoundEditor1.TagsEditor.FLAC_PictureFrameMemoryFileGet (0, byteBuffer, nSizeInBytes)

 

...

use the buffer

...

}

 

 

Visual C#

 

private void buttonGetPicture_Click(object sender, System.EventArgs e)

{

// get the size of the picture in bytes

Int32 nSizeInBytes = 0;

AudioSoundEditor1.TagsEditor.FLAC_PictureFrameSizeGet (0, ref nSizeInBytes);

if (nSizeInBytes == 0)

   return;

 

// allocate the receiving buffer

byte[] byteBuffer = new byte[nSizeInBytes];

 

// read picture data

AudioSoundEditor1.TagsEditor.FLAC_PictureFrameMemoryFileGet (0, byteBuffer, nSizeInBytes);

 

...

use the buffer

...

}