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

Discussion in 'C Programming' started by kanchan, Nov 13, 2004.

  1. kanchan

    kanchan Guest

    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.
     
    kanchan, Nov 13, 2004
    #1
    1. Advertising

  2. Re: using pthread to receive data on a socket and simultaneouslyplay it using /dev/dsp

    kanchan wrote:
    > 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 .

    --
    Karthik.
    ' Remove _nospamplz from my email to mail me. '
     
    Karthik Kumar, Nov 13, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Collier

    resetting buffer on /dev/dsp

    Andrew Collier, Aug 20, 2003, in forum: C Programming
    Replies:
    3
    Views:
    1,237
    Kevin Easton
    Aug 20, 2003
  2. Tito
    Replies:
    1
    Views:
    390
  3. Pallav singh
    Replies:
    6
    Views:
    2,020
    James Kanze
    Jun 14, 2009
  4. twgray
    Replies:
    15
    Views:
    3,552
  5. Kamaljeet Saini
    Replies:
    10
    Views:
    243
    Brian Candler
    Jan 26, 2009
Loading...

Share This Page