[opus] playback of opus files using portaudio

Akshit Jain jaina488 at gmail.com
Thu Dec 5 09:27:04 PST 2013


I am making a lightweight opus audio player. This is my portaudio callback
function. But i hear a stammering song when i try to play a .opus song
file. Can anybody say what is wrong or provide me link to any code which
can play opus file written in c/c++(light). I tried to see some open
source(vlc opus play) but was unable to follow.

int MyCallback(const void* input,
   void* output,
   unsigned long frameCount,
   const PaStreamCallbackTimeInfo* paInfo,
   PaStreamCallbackFlags paCallbacks,
   void *userData
   )
{
OurData *data=(OurData*) userData;
opus_int16* out=(opus_int16 *)output;
int thisSize=frameCount;
int smpls_decoded;
while (thisSize>0)
{
smpls_decoded=op_read(data->sndFile,out,thisSize,NULL);
out+=data->channels*smpls_decoded;
thisSize-=data->channels*smpls_decoded;
}
  return paContinue;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/opus/attachments/20131205/236007a9/attachment.htm 


More information about the opus mailing list