in poche parole mi piacerebbe trasformare questo blocco che legge da file. (io invece dovrei leggere da buffer LPSTR:

codice:
// Init the MP3 Stream
beInitStream(&bec, &dwSamples, &dwMP3Buffer, &hbeStream);

// Allocate MP3 buffer
PBYTE pMP3Buffer = new BYTE[dwMP3Buffer];

// Allocate WAV buffer
PSHORT pWAVBuffer = new SHORT[dwSamples];

// Convert All PCM samples
while ( ( dwRead = fread(pWAVBuffer, sizeof(SHORT), dwSamples, pFileIn)) > 0 )
{
	// Encode samples
	beEncodeChunk(hbeStream, dwRead, pWAVBuffer, pMP3Buffer, &dwWrite);

	// write dwWrite bytes that are returned in tehe pMP3Buffer to disk
	fwrite(pMP3Buffer,1,dwWrite,pFileOut) != dwWrite)
}