Re: WaveOutWrite and Sockets
- From: "Black_angel" <Blackangel@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Apr 2005 04:17:02 -0700
yes Almon,
I have re-readen the thread.
Here is the explain:
>Hi,
>
>Pay attention to the things you have been told.
>
>Anyway, you shouldn't waveOutWrite dozens of buffers
>at a time--It should be "several" or "a handful."
>You should go for attempting to maintain a count of
>several buffers. You have to balance the issues of
>network latency and CPU cycle starvation versus what
>an unacceptable audio delay is. This is the hardest part.
>
////////////////////////
The time of the packets is 100 ms.
I have a timer that when 100ms pass.. it takes a packet of a queue where the
packets arrive from the Socket. but... as the PPC isn't a real time
plataform, when I receive an STILL_PLAYING error it waits 150ms
I have 5 buffers.
///////////////////////
>You need to understand a few more concepts:
>1. One of those concepts, as Robert stated several times,
>is if you have an input samplerate that is even very slightly
>higher than your output rate when they are nominally the
>same, if you don't occasionally hiccup/skip on the output,
>the data backup will CONTINUALLY INCREASE.
/////////////////
That is why when I receive a STILL_PLAYING error I delete that packet and I
wait 150ms.
////////////////
>
>2. Also, packets/buffers that you waveOutWrite, are packets
>that you are handing over to the system. You don't get to
>mess with them/re-waveOutWrite them, until the system
>has flushed them and "given" them back to you. You must
>not ignore this, otherwise you will get anything from an error
>every once in a while to errors all the time.
////////////////////
if I don't use Socket all the time and only playback continuously the first
packet it works fine.
////////////////////
>
>3. You also need to understand keeping the continuity of the
>sample data--ie. The first sample from a buffer should come
>right after the last sample from the previous buffer seamlessly.
>This means you should always have more than one buffer
>queued--And frankly more than 2, because there is a latency
>from a buffer being flushed to when you are notified about it.
>ie. Time goes by, so you are ALREADY playing the next buffer.
/////////////////////////////
yes, I have 5 buffers and I manage the queue to know if there are a lot of
packets or not.
///////////////////////////
>
>Given these, your errors are not surprising at all.
>
>Hope this helps...
>
>Almon B. Strowger
KOOK Pocket Software
"Almon B. Strowger" wrote:
>
> Hi,
>
> I suggest re-reading the thread started by you on March 16th.
>
> Almon B. Strowger
> KOOK Pocket Software
.
- Follow-Ups:
- Re: WaveOutWrite and Sockets
- From: Almon B. Strowger
- Re: WaveOutWrite and Sockets
- References:
- WaveOutWrite and Sockets
- From: Black_angel
- Re: WaveOutWrite and Sockets
- From: Almon B. Strowger
- WaveOutWrite and Sockets
- Prev by Date: Symbol MC50 handheld...
- Next by Date: Re: Updating a CDB File
- Previous by thread: Re: WaveOutWrite and Sockets
- Next by thread: Re: WaveOutWrite and Sockets
- Index(es):
Relevant Pages
|