RE: Re: mad-dev digest, Vol 1 #368 - 2 msgs

Nigel Sinfield <[email protected]>
Newsgroups gmane.comp.audio.mad.devel
Message-ID <38FAC1BF23EE6146A0C034DD280D22573A28FF@mast-hk0-se03.private.ntl.com>
> > I'm planning to use MAD in a streaming application.  I have no
> > control over
> > the incoming data rate, although it is ostensibly CBR data with a
> > fixed
> > sample rate.  Similarly, the processing rate of the decoded 
> samples is
> > controlled by the DAC.  So inevitably sooner or later I'll get a
> > buffer
> > overflow or underflow.
> 
> So if I understand, the input can be for instance 128kbps or 
> 160kbps, but
> the DAC expects a fixed rate of PCM samples? I don't see a 
> problem then,
> since the rate of PCM samples is independent on the bitrate of the
> MPEG-stream. So your PCM-samples will be delivered to the DAC 
> with always
> the same speed.

Thanks.  I do know the sample rate (in fact, I need to resample the data
from typically 48000Hz mono to 22050Hz stereo after the decode).  My problem

is that the DAC runs autonomously, and interrupts when it wants more data.  
I can't 'choose' how fast to give it samples.  As the CPU and DAC clocks 
won't be exactly synchronised, over time I'll end up with either too many 
or too few samples in my buffer.  

I guess I need to add or delete samples, either by changing the buffer or 
by adjusting the resampling ratio slightly.  My question is when to do it 
and how much to adjust.



The contents of this email and any attachments are sent for the personal attention
of the addressee(s) only and may be confidential.  If you are not the intended
addressee, any use, disclosure or copying of this email and any attachments is
unauthorised - please notify the sender by return and delete the message.  Any
representations or commitments expressed in this email are subject to contract. 
 
ntl Group Limited
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.