Page 1 of 1

A question about Oolite and audio sample-rates

Posted: Thu May 16, 2013 12:46 am
by Diziet Sma
Background:

I was recently making up a Hyperradio musicpack for my own use, when I ran across an interesting problem. The artist Moby very generously makes all of his music available for free download at his website. (This is for personal use only, of course. Also, he doesn't mind if people use his music as background in not-for-profit movies or videos, but they must obtain his permission first. If I can obtain his permission, I will release the musicpack to the Oolite community.)

However.. it turns out that the MP3s from his website are all encoded at 24kHz. When converted to Ogg Vorbis and played with Hyperradio, they play at (almost) double speed. To be honest, most of it still sounds fairly good even at that speed, however, the tracks with vocals sound like they're being sung by the Chipmunks, which is rather disconcerting, and the songs are over far too quickly.

The solution, of course, was pretty simple.. I used Audacity to re-encode the .ogg files at 44.1kHz, and everything now sounds as it should. Which brings us to my..

Question:

Oolite appears to treat all .ogg files as if they were sampled at 44.1kHz, and plays them accordingly. Is this just a limitation of the music-playing capabilities of Oolite on Linux, or does it apply to the Mac and Windows versions as well? I intend to add an additional section to the musicpack howto on the Wiki, warning of the importance of the sample-rate and how to deal with it if necessary, but before I do so, I'd like to be clear on whether this is a situation which applies equally to all platforms, or just one or two.

Re: A question about Oolite and audio sample-rates

Posted: Thu May 16, 2013 1:31 pm
by Svengali
In 2008 I've written a small test-OXP for sound formats (updated 2010) -> Soundcheck1.1.zip. It checks 22.050, 44.1, 48 and 96 KHz files in different formats (wav,raw,ogg,flac). You could give it a go and see what works on your box.

Re: A question about Oolite and audio sample-rates

Posted: Thu May 16, 2013 2:04 pm
by Diziet Sma
Cool idea.. thanks!

Although I've already got a fair idea of how it works on mine.. I'm more interested in knowing if all three platforms are the same.. kinda hoping one of the devs will chime in on the subject..

Re: A question about Oolite and audio sample-rates

Posted: Thu May 16, 2013 2:32 pm
by Svengali
I'd think your converter has mixed it up. Oolite supports 22.050, 44.1, 48 and 96 KHz files pretty well. Although I haven't checked non-standard sample rates. 24 KHz smells like a 1/4 rate of studio stuff (96 KHz). And there's more to say about it, e.g. VBR vs constant bit rates, etc., but it is a complex field. E.g. normalized .ogg files with VBR and nominal bit rate of 160kbps should work well.

Re: A question about Oolite and audio sample-rates

Posted: Thu May 16, 2013 4:38 pm
by Diziet Sma
Well, the mp3 files downloaded as 24 kHz, and all I did originally to convert them was open each file with Audacity, reduce the levels a little (as recommended in the how-to) and make sure the tracks faded to zero at the end. Then exported the result as .ogg. To fix them, I opened the .ogg's again in Audacity, changed the project rate to 44.1 kHz, and exported once more.

I really don't see Audacity messing it up.. it's one of the best general-purpose open-source audio editors around. (Granted, it's not on a par with Ardour, Cubase or Sonar, all of which I used to use when I was a partner in a studio, but it's still a decent, mature editor) As you say, perhaps it's the non-standard sample rate that confused Oolite. I'll run some tests, converting to 22.050, 48 and 96 kHz as well, now that I know Oolite supports them. (Incidentally, both Ogg Vorbis and Flac are inherently VBR codecs anyway, they don't really 'do' CBR.)

Re: A question about Oolite and audio sample-rates

Posted: Thu May 16, 2013 8:16 pm
by Svengali
Diziet Sma wrote:
To fix them, I opened the .ogg's again in Audacity, changed the project rate to 44.1 kHz, and exported once more.
Yep, the project sample rate is the key if you are changing the tracks sample rate (and maybe if a custom sample rate is used - haven't checked it). And I agree completely - Audacity is a nice tool, small, not overloaded and easy to use. And some plugins are making it more powerful (sure - not as powerful as some of the commercial tools like ProTools or the ones you've mentioned, but still a pretty good editor).
Diziet Sma wrote:
(Incidentally, both Ogg Vorbis and Flac are inherently VBR codecs anyway, they don't really 'do' CBR.)
Yes (and no), most exporters don't support advanced encoder settings for Ogg Vorbis, but some do and CBR is possible. I haven't tested if files encoded with CBR can be decoded in Oolite though.
Diziet Sma wrote:
...all of which I used to use when I was a partner in a studio...
Welcome to the club .-)

Re: A question about Oolite and audio sample-rates

Posted: Fri May 17, 2013 4:26 am
by Diziet Sma
Svengali wrote:
Diziet Sma wrote:
(Incidentally, both Ogg Vorbis and Flac are inherently VBR codecs anyway, they don't really 'do' CBR.)
Yes (and no), most exporters don't support advanced encoder settings for Ogg Vorbis, but some do and CBR is possible. I haven't tested if files encoded with CBR can be decoded in Oolite though.
Well yes, it can be forced to do so (kind of).. but I think that's kind of crippling it, a little.. and unless the way it does CBR has been improved on since I last checked, (very possible) it doesn't do so 100%.
Svengali wrote:
Diziet Sma wrote:
...all of which I used to use when I was a partner in a studio...
Welcome to the club .-)
8) The most fun 'job' I ever had.. hope you're enjoying it as much as I did!

Re: A question about Oolite and audio sample-rates

Posted: Fri May 17, 2013 9:27 am
by Svengali
Diziet Sma wrote:
8) The most fun 'job' I ever had.. hope you're enjoying it as much as I did!
Well, it was fun while it lasted... .-)

Re: A question about Oolite and audio sample-rates

Posted: Sat May 18, 2013 3:48 am
by Diziet Sma
Ah yes.. "all good things..."