[Vorbis] ogg audio streaming problem

leon deng pluginstarter at gmail.com
Thu Jun 4 00:56:17 PDT 2009


Hi,guys
Hope you are doing well!
I am an ogg format starter, and I am implementing ogg audio streaming.
I meet some problems for streaming.

My application is as follows:
I send download request to server,and server sends the download ogg file to
client side.
when  a certain amount of data is downloaded, and I start to play the ogg
file by using a library.

I use juce c++ library which uses vorbisfile.c to read and write ogg format.

I updated the lengthInSamples of the ogg file to the size of ogg file.
After certain chunk of data is downloaded,
ogg length in samples is initialized by

        callbacks.read_func = &oggReadCallback;
        callbacks.seek_func = &oggSeekCallback;
        callbacks.close_func = &oggCloseCallback;
        callbacks.tell_func = &oggTellCallback;

        const int err = ov_open_callbacks (input, &ovFile, 0, 0, callbacks);

    lengthInSamples = (uint32) ov_pcm_total (&ovFile, -1);
input is the file stream.

The first chunk data is played excellent, however, after that , it gives me
static noise.
I debugged the decoder, and it seems that the ogg pattern is not decoded
right in this case.
In vorbisfile.c
static long _get_data(OggVorbis_File *vf){
....
  long bytes=(vf->callbacks.read_func)(buffer,1,CHUNKSIZE,vf->datasource);
..
}

The buffer should hold the header feild "oggs", however, it did not.
I think the problem is vf->seekable = 1.
if the vf->seekable = 1, is it the problem for streaming? How can I achieve
ogg streaming?

Thank you in advance!

Leon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis/attachments/20090604/511372bf/attachment.htm 


More information about the Vorbis mailing list