Copyright © 2008-2018 MultiMedia Soft

TagsEditor.ID3V2_PrivateFrameMemoryFileGet method

Previous pageReturn to chapter overviewNext page



Obtains a copy in memory of the file stored inside an ID3V2 private frame (PRIV).


For further details about methods related to tags editing refer to the TagsEditor object.

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





[Visual Basic]

control.TagsReader.ID3V2_PrivateFrameMemoryFileGet (

nIndex as Integer,

pBuffer as variant,

nBufferLen as long

) as enumErrorCodes



short control.TagsReader.ID3V2_PrivateFrameMemoryFileGet (

short nIndex,

const VARIANT FAR& pBuffer,

long nBufferLen









Zero-based index of the private frame. The total number of general object frames available inside the ID3V2 tag can be obtained through a call to the TagsEditor.ID3V2_FrameCountGet method with the strFrameId parameter set to "PRIV".


Output buffer that, on return from the method call, will contain the file data


Length of the buffer expressed in bytes. The size for the memory buffer can be obtained through the TagsReader.ID3V2_PrivateFrameSizeGet method.



Return value






Negative value

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

enumErrorCodes.NOERROR (0)

The method call was successful.



Below you can find a couple of samples that demonstrate how to retrieve a general object and store it inside a memory buffer in Visual Basic 6 and Visual C++ 6:


Visual Basic 6


Private Sub Command1_Click()

' obtain the size in bytes of the first private frame (having index 0)

Dim nSizeInBytes As Long

ActiveSoundEditor1.TagsReader.ID3V2_PrivateFrameSizeGet 0, nSizeInBytes

if nSizeInBytes = 0 then Exit Sub


' allocate the destination buffer

Dim bytImage() As Byte

ReDim bytImage(nSizeInBytes)      


' read frame's data into the buffer

ActiveSoundEditor1.TagsReader.ID3V2_PrivateFrameMemoryFileGet 0, VarPtr(bytImage(0)), nSizeInBytes      



use the buffer



' erase the buffer and free memory

Erase bytImage

End Sub



Visual C++ 6 with MFC


void CReadId3v2Dlg::OnButton1()


long nSizeInBytes = 0;

m_editor.TagsReader.ID3V2_PrivateFrameSizeGet (0, &nSizeInBytes);

if (nSizeInBytes == 0)



BYTE *pBuffer = new BYTE[nTagSize];


COleVariant var;

var.vt = VT_BYREF | VT_UI1;

var.pbVal = pTagBuffer;

m_editor.TagsReader.ID3V2_PrivateFrameMemoryFileGet (0, var, nSizeInBytes);



use the buffer



delete pBuffer;