Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

OGG not importing correctly?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Guest
Guest






PostPosted: Mon Jan 04, 2010 12:08 pm    Post subject: OGG not importing correctly? Reply with quote

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)

PostPosted: Mon Jan 04, 2010 1:13 pm    Post subject: Re: OGG not importing correctly? Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Guest
Guest






PostPosted: Mon Jan 04, 2010 4:11 pm    Post subject: Reply with quote

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

PostPosted: Mon Jan 04, 2010 10:09 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Tue Jan 05, 2010 7:49 am    Post subject: Reply with quote

Good point. What is the sample rate of the files, Guest?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
J_Taylor
The Self-Proclaimed King of Ketchup




Joined: 02 Dec 2009
Posts: 188
Location: Western NY

PostPosted: Tue Jan 05, 2010 11:05 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Tue Jan 05, 2010 11:32 am    Post subject: Reply with quote

The easiest way that I know of to check sample rate is by opening the file in audacity.

Back to top
View user's profile Send private message Send e-mail Visit poster's website
Guest
Guest






PostPosted: Tue Jan 05, 2010 1:18 pm    Post subject: Reply with quote



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)

PostPosted: Tue Jan 05, 2010 1:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Guest
Guest






PostPosted: Tue Jan 05, 2010 1:53 pm    Post subject: Reply with quote

Thanks very much--it works great now! Happy

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)

PostPosted: Tue Jan 05, 2010 3:11 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Wed Jan 06, 2010 3:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group