[Tremor] Resampling while decoding
Martin Vilcans
mvilcans at digital-legends.com
Fri Jun 16 08:12:53 PDT 2006
Hi list,
I'm developing a game that will use Tremor for decoding Vorbis and got
this idea about supporting different sample rates. We'll have to support
several different sample rates but the Vorbis streams are at a fixed
frequency. We can resample the decoded samples in realtime, but I'm
wondering if there is a more efficient way to play back a Vorbis stream
at a specific sampling rate. I suspect that there might be some
efficient way to resample while decoding, but this might be just because
I don't know much of how a Vorbis stream is constructed.
Also, perhaps it's possible to increase quality without sacrificing
speed. For example, if the Vorbis stream uses a rate of 44 kHz, but the
playback rate is 22 kHz, we'd normally decode the stream, apply a
high-pass filter to remove frequencies above the Nyqvist frequency and
resample by averaging every two samples. Instead, perhaps the decoder
can simply not decode the upper half of the frequency spectrum (the
11-22 kHz band). That would give the same effect as applying a low-pass
filter to the decoded samples. Then we can do a quick resample by simply
removing every other sample.
As I said, I don't know much of how Vorbis works, so perhaps all of this
is just stupid, but I'd be happy to be enlightened if that is the case. :-)
--
Martin Vilcans
Lead Programmer
mvilcans at digital-legends.com
Digital Legends Entertainment
C/ Aribau 112, 5-1
08036 Barcelona (Spain)
Tel : +34 93 394 17 77
Fax: +34 93 451 19 80
www.digital-legends.com <http://www.digital-legends.com>
More information about the Tremor
mailing list