using pthread to receive data on a socket and simultaneously play it using /dev/dsp

K

kanchan

Hi, I am writing a client for a real time audio streaming server. I am
using pthread for that. I have one thread receiving data on a socket from
the server. After buffering some data, other thread wakes up (checking how
much data is in the buffer) to play the music. The problem is that when the
2nd thread is playing, the first thread is not able to receive data from
the server. If the server sends the data slow, then there will be breaks
in the audio. How do I solve this problem?

Thanks.
 
K

Karthik Kumar

kanchan said:
Hi, I am writing a client for a real time audio streaming server. I am
using pthread for that. I have one thread receiving data on a socket from
the server. After buffering some data, other thread wakes up (checking how
much data is in the buffer) to play the music. The problem is that when the
2nd thread is playing, the first thread is not able to receive data from
the server. If the server sends the data slow, then there will be breaks
in the audio. How do I solve this problem?

Thanks.
This is O.T here. May be - comp.unix.programmer might be helpful.

http://groups-beta.google.com/group/comp.unix.programmer .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top