The Ogg-Opus stream from the internet radio is transmitted with the following structure:
Page0: ID Header (47 bytes)
Page1: Comment Header (89 bytes)
Page2: Audio Data Packet (approximately 2400 bytes)
...
Page(n): Audio Data Packet (approximately 2400 bytes)
In the FILEREADPROC, I simply sent Page0, Page1, Page2 in order, but it didn't work.
With STREAMFILE_BUFFERPUSH, I sent the combined data (Page0 + Page1 + Page2) to FILEREADPROC.
Do I still need to manipulate the data with STREAMFILE_BUFFER?
int MyFileProcUserRead(IntPtr buffer, int length, IntPtr user)
{
if (_br == null) //_br(BinaryReader)=Page0,Page1,Page2,,,Page(n)
return 0;
try
{
byte[] _data = new byte[length];
int bytesread = _br.Read(_data, 0, length);
Marshal.Copy(_data, 0, buffer, bytesread);
Debug.WriteLine(String.Format("MyFileProcUserRead: requested {0}, read {1} ", length, bytesread));
return bytesread;
}
catch
{
return 0;
}
}