gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Quick DS Sound Format

#157646 - thegamefreak0134 - Tue May 27, 2008 5:18 pm

I'm looking to add sound into my program, namely in the form of short alerts and clicks, so that my interface (namely the keyboard) is a bit better. I don't need to play music, I just need to play a few short samples, one at a time.

I can probably figure out how to use the sound functions themselves from the examples. My question is on sound format. What format do I need to convert my .wav files to for the function to use the binary data, and what should I use to perform this conversion?

!sknahT

-thegamefreak0134
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#157670 - DensitY - Tue May 27, 2008 7:56 pm

For soundFX I recommend you use SoX (Sound eXchange) and store sounds in 8-11khz 8bit mono Raw format. So long as the sound bites are short in length (ie 1-2 seconds) raw format is perfect.

#157678 - silent_code - Tue May 27, 2008 8:13 pm

actually, most of the time i read about this on this forum, people tend to recommend sample rates that are a fraction of the hw sampling rate (which is around 32khz). ;^)

gbatek wrote:
The sampling frequency of the mixer is 1.04876 MHz with an amplitude resolution of 24 bits, but the sampling frequency after mixing with PWM modulation is 32.768 kHz with an amplitude resolution of 10 bits.


EDIT: <lol> sorry, DY! ;?D
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.


Last edited by silent_code on Tue May 27, 2008 9:13 pm; edited 1 time in total

#157680 - DensitY - Tue May 27, 2008 8:18 pm

lol silent_code is on my case today hehe.

when I did sound testing when I coded up a sound engine a little while ago, I tested sound at a few different sample rates. to be fair, I couldn't tell the quality difference between the DS's native hardware mixer of 32khz and my test samples at 22khz, 11khz and a slight quality loss at 8khz. so i picked 11khz since I could stuff more sound into my budgeted amount of ram for sound :)

#157709 - thegamefreak0134 - Tue May 27, 2008 10:35 pm

I can tell the difference between 11Khz and 22Khz when wearing headphones, which I tend to do. However, I don't think I need quality for these.

SoX sounds interesting, that's what I needed to know. Thanks!

-thegamefreak0134
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]