TagsEditor.WAV_BextChunkBinaryFieldSet method |
|
Remarks
Writes a binary field of the WAV Bext chunk. Current contents can be retrieved through the TagsEditor.WAV_BextChunkTextFieldGet method.
The modification only happens in memory and not directly into the original sound file: in order to store modifications inside the file you need to call the TagsEditor.WAV_SaveChanges 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_BextChunkBinaryFieldSet ( nFieldId as enumBextChunkBinaryField, pBuffer() as Byte, nBufferLength as Int32 ) as enumErrorCodes |
[C#] public string WAV_BextChunkBinaryFieldSet ( enumBextChunkBinaryField nFieldId, byte[] pBuffer, Int32 nBufferLength ); |
[C++] public: string WAV_BextChunkBinaryFieldSet ( enumBextChunkBinaryField nFieldId, unsigned char __gc[] pBuffer, Int32 nBufferLength ); |
Parameter |
Description |
|||||||||
|
|
|||||||||
nFieldId |
Identifier of the binary field to read. Supported values are the following:
|
|||||||||
pBuffer |
Input buffer containing binary data to write inside the requested field. |
|||||||||
nBufferLength |
The size of the buffer 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
m_audioSoundEditorApi.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
m_audioSoundEditorApi.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;
m_audioSoundEditorApi.TagsEditor.FLAC_PictureFrameSizeGet (0, ref nSizeInBytes);
if (nSizeInBytes == 0)
return;
// allocate the receiving buffer
byte[] byteBuffer = new byte[nSizeInBytes];
// read picture data
m_audioSoundEditorApi.TagsEditor.FLAC_PictureFrameMemoryFileGet (0, byteBuffer, nSizeInBytes);
...
use the buffer
...
}