View previous topic :: View next topic |
Author |
Message |
Guest Guest
|
Posted: Mon Jan 04, 2010 12:08 pm Post subject: OGG not importing correctly? |
|
|
When I import OGG files, some of them come out slower and lower pitched than they should be. This occurs with both files that were always OGG and ones that were converted to it from MP3.
Why is this happening, and is there a solution to the problem? |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Mon Jan 04, 2010 1:13 pm Post subject: Re: OGG not importing correctly? |
|
|
Guest wrote: | When I import OGG files, some of them come out slower and lower pitched than they should be. This occurs with both files that were always OGG and ones that were converted to it from MP3.
Why is this happening, and is there a solution to the problem? |
Do they play correctly with Audacity? http://audacity.sourceforge.net/ |
|
Back to top |
|
 |
Guest Guest
|
Posted: Mon Jan 04, 2010 4:11 pm Post subject: |
|
|
Yes, they do. They seem completely normal, but then when they get imported, they get slooooow.... |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Jan 04, 2010 10:09 pm Post subject: |
|
|
This is likely because the sample rate of the music is something unusual. Unfortunately, the SDL_Mixer library, which is used by our default music 'backend' music_sdl, is not very good and can not handle files with unusual sample rates, and even crashes when attempting to play such an MP3 file (which is why we convert all MP3s to OGGs). The solution is to resample the music to something like 44.1kHz. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Jan 05, 2010 7:49 am Post subject: |
|
|
Good point. What is the sample rate of the files, Guest? |
|
Back to top |
|
 |
J_Taylor The Self-Proclaimed King of Ketchup

Joined: 02 Dec 2009 Posts: 188 Location: Western NY
|
Posted: Tue Jan 05, 2010 11:05 am Post subject: |
|
|
This is a good question. I've encountered the same problem. Like, I import the music as a sound effect, it turns out fine; I import it as music, too slow.
And my sample rate is whatever Magix sets it at... Oh, yeah. Magix Music Maker 7 was freeware last I checked. The new ones aren't, though. Not that that's a prob for me. _________________ Elemental: .75%
Heart of Darkness: 0% (crash)
The Mansion: .05%
Shattered Alliance: .05%
See a pattern forming? I do, dammit. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Jan 05, 2010 11:32 am Post subject: |
|
|
The easiest way that I know of to check sample rate is by opening the file in audacity.
 |
|
Back to top |
|
 |
Guest Guest
|
Posted: Tue Jan 05, 2010 1:18 pm Post subject: |
|
|
Looks like my sample rate is 48000Hz. Do I just change the "Project Sample Rate" down to 44100, and then export it again to fix this? |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Jan 05, 2010 1:34 pm Post subject: |
|
|
Guest wrote: | Looks like my sample rate is 48000Hz. Do I just change the "Project Sample Rate" down to 44100, and then export it again to fix this? |
Exactly right :) |
|
Back to top |
|
 |
Guest Guest
|
Posted: Tue Jan 05, 2010 1:53 pm Post subject: |
|
|
Thanks very much--it works great now!
By the way, is there a way to quickly change the sample rate for a whole bunch of OGGs, or am I going to have to do it manually one by one? |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Jan 05, 2010 3:11 pm Post subject: |
|
|
Hmmm... you could probably do it with http://sox.sourceforge.net/ and a batch file, but depending on how many files you have to work with, it may or may not be worth the trouble of figuring it out... |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed Jan 06, 2010 3:43 am Post subject: |
|
|
We could automatically detect and resample OGG files in incompatible sample rates, but unfortunately we'd have to include something like oggdec and ogginfo. (But oggdec at least is much smaller than oggenc, ogginfo probably also)
Quote: | By the way, is there a way to quickly change the sample rate for a whole bunch of OGGs, or am I going to have to do it manually one by one? |
Here's a simple .bat file for you:
Code: | :loop
@if not exist "%~1" goto end
oggdec -w temp.wav %1
oggenc -q 4 --resample 44100 -o new_%1 temp.wav
@shift
@goto loop
:end
@del temp.wav |
Download oggdec and oggenc and put them in the same folder as the .bat file, as well as all the ogg files. Then specify all the files as arguments to the batch script, or just drag-drop them onto it. I set the encoding quality to 4, feel free to fiddle with that. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|