Hi Ico,
The problem you are having with unmatched sampling rates is a common
problem since the ADC/DAC clocks of two different sound cards are never
exactly the same.
For speech the problem is dealt with most elegantly using silence
compression/expansion. However, this only applies if you are using a codec
with a voice activity detector (VAD). Anyway, the basic theory is that you
try to keep the latency the same by expanding or contracting the silence
portions of the conversation. Subjective studies have shown that
expanding/contracting the silence portions is not annoying to human
listeners (within reason of course - I don't remember the rule of thumb off
hand). Usually, this functionality is an integral portion of the packet
scheduling algorithm (jitter buffer), which also deals with network latency
and jitter.
If you are not using a VAD, it is possible to pull some other stunts
such
as interpolation/decimation of frames of speech. (ie temporarily increase
the far-end's sampling rate to decrease the jitter buffer queue size) This
is less desirable since the effect is more easily detectable by the human
listener. If you are working with music this may be the only way - although
I haven't worked much with music.
Of course, the easiest way is to throw away or repeat a frame here and
there. Not the most elegant, but it does work and it's the least
computationally complex. This technique has the most detrimental effect on
human listeners (if the frames are small enough the effect is less
noticeable).
Cheers,
Trevor Yensen, Ph.D.
Maplebrook Consulting Inc.
www.maplebrook.com
<p><p>-----Original Message-----
From: owner-speex-dev@xiph.org [mailto:owner-speex-dev@xiph.org]On
Behalf Of Ico Doornekamp
Sent: Thursday, June 19, 2003 8:23 AM
To: speex-dev@xiph.org
Subject: [speex-dev] Sample rate inaccuracy
<p><p>Hi all,
I'm having some problems with inaccurate sampling rates between sending
and receiving party. (Using a simple raw UDP protocol sending packets
from speex to speex)
Both PC's have their soundcard set to 8 khz, but the samplerate seems to
differ slightly between machines. The problem I have is that the sending
machine sometimes samples with a slightly lower rate than the player
machine. This causes the audio data to 'heap up' in network buffers etc,
and thus slowly increases the latency.
What is a common way to prevent this from happening ?
Thanks,
Ico
--
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to
'speex-dev-request@xiph.org'
containing only the word 'unsubscribe' in the body. No subject is
needed.
Unsubscribe messages sent to the list will be ignored/filtered.
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to
'speex-dev-request@xiph.org'
containing only the word 'unsubscribe' in the body. No subject is
needed.
Unsubscribe messages sent to the list will be ignored/filtered.