Lukasz Minkiewicz
2009-Feb-13 08:57 UTC
[Speex-dev] Decoding from memory using libfishsound
Hi, I have a problem. I've started to develop crossplatform sound receiving application using qt4/openal/libfishsound. Server is streaming audio coded with speex in ogg container throuh http. I'm receiving packages and when I write them to file application example from libfishsound is properly decoding it. Problem starts, when I want to decode from memory, for example: receive few packages, decode them and send to sound card. This is code for decoding, which cast callback function read_packet. oggz = oggz_open_stdio(newfile,OGGZ_READ); oggz_set_read_callback (oggz, -1, read_packet, fsound); while ((n = oggz_read (oggz, 1024)) > 0); I've tried to create object using oggz_new, a write from memory data using oggz_read, but it doesn't worked. Data from package is stored in QByteArray which can return char*. Please help me, because I'm stucked at least a month and can't find a solution. Lukasz
2009/2/13 Lukasz Minkiewicz <lukasz.minkiewicz at gmail.com>:> Hi, > I have a problem. I've started to develop crossplatform sound > receiving application using qt4/openal/libfishsound. Server is > streaming audio coded with speex in ogg container throuh http. I'm > receiving packages and when I write them to file application example > from libfishsound is properly decoding it. Problem starts, when I want > to decode from memory, for example: receive few packages, decode them > and send to sound card. > > This is code for decoding, which cast callback function read_packet. > > oggz = oggz_open_stdio(newfile,OGGZ_READ); > oggz_set_read_callback (oggz, -1, read_packet, fsound); > while ((n = oggz_read (oggz, 1024)) > 0); > > I've tried to create object using oggz_new, a write from memory data > using oggz_read, but it doesn't worked. > Data from package is stored in QByteArray which can return char*. > Please help me, because I'm stucked at least > a month and can't find a solution.Hi, what versions of liboggz and libfishsound are you using? To feed data from memory you should use oggz_read_input() which takes a memory buffer. Conrad.