At 10:15 PM 1/23/01 -0600, you wrote:>I just used ogg123 to play back a file encoded from a 22.5 KHz WAV, and it
>played twice too fast. Looking at the source, it seems that the sampling
rate>and number of channels are hard-coded into it. What´s the best way of
fixing
>this? I quickly hacked together something that closes and reopens the
devices>before each file (diff attached). Is there a better solution?
The 'right' solution here is to open the audio device(s) only once the
relevent parameters are known, and then ONLY reopen it if those change (so,
if you're playing multiple files with the same sampling rate, etc, you
don't close the device between files.
I don't have the time right now to dig into ogg123 (that part of the code
is a bit messy, as I recall), but if you send a patch to do this, I'll
commit it - the patch you attached ends up opening/closing multiple times
even for a single file. If you don't do this, I'll try and hack
something
in later in the week.
Under some circumstances you might want to do so, though (the obvious one
is file output, but ogg123 gets this wrong for multiple files anyway - I
haven't checked, but I think it'll just overwrite the file).
Really, the best thing to do is to rewrite much of the libao<->ogg123
interface (by making libao do a lot more, and/or more flexibly, than it
does now, and then making ogg123 use the new interfaces), and fix little
things like this in the process. I don't think anyone really wants to do
that, though. I might take a stab at it next weekend, if I'm not too busy.
Michael
--- >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
'vorbis-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.