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.
A question about Oolite and audio sample-rates
Moderators: winston, another_commander
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
A question about Oolite and audio sample-rates
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Re: A question about Oolite and audio sample-rates
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.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: A question about Oolite and audio sample-rates
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..
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..
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Re: A question about Oolite and audio sample-rates
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.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: A question about Oolite and audio sample-rates
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.)
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.)
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Re: A question about Oolite and audio sample-rates
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:To fix them, I opened the .ogg's again in Audacity, changed the project rate to 44.1 kHz, and exported once more.
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:(Incidentally, both Ogg Vorbis and Flac are inherently VBR codecs anyway, they don't really 'do' CBR.)
Welcome to the club .-)Diziet Sma wrote:...all of which I used to use when I was a partner in a studio...
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: A question about Oolite and audio sample-rates
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: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:(Incidentally, both Ogg Vorbis and Flac are inherently VBR codecs anyway, they don't really 'do' CBR.)
The most fun 'job' I ever had.. hope you're enjoying it as much as I did!Svengali wrote:Welcome to the club .-)Diziet Sma wrote:...all of which I used to use when I was a partner in a studio...
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Re: A question about Oolite and audio sample-rates
Well, it was fun while it lasted... .-)Diziet Sma wrote:The most fun 'job' I ever had.. hope you're enjoying it as much as I did!
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: A question about Oolite and audio sample-rates
Ah yes.. "all good things..."
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied