What is a game without sound? What is anything without sound?
What is even (our experience of) space without sound???
So sound is important.
But first of all, you want to have pictures, movement, and or levels in your game.
Ok, if you are on your way with this sound has to be added.
Difficult?
Hmmmm, as everything on the ds, somehow difficult, after a while less so.
16 channels!
The first "layer" is not too difficult, but it can become complex, just because also sound is complex, not just sprites!
links:
the simple devkitpro example: sound is very instructive and shows how easy it is, it gives two examples in one:
see all code there:
//first way setting up:
// set the generic sound parameters
setGenericSound(
11025, /* sample rate */
127, /* volume */
64, /* panning */
1 ); /* sound format*/
//second way:
TransferSoundData blaster = {
blaster_raw, /* Sample address */
blaster_raw_size, /* Sample length */
11025, /* Sample rate */
127, /* Volume */
64, /* panning */
1 /* format */
};
both are simple to implement and understand:
if ( keys & KEY_A) playGenericSound(saberoff_raw, saberoff_raw_size);
//using first setting up
if ( keys & KEY_R) playSound(&blaster); //second
Preparation:
the sounds have to be prepared in sox, from a .wav fromat to a .raw format, can be included like that and it works!
but then you need a loop sound!!!
http://www.double.co.nz/nintendo_ds/nds_develop4.html
Here you can read more about the sound settings, and see that it might become a bit more complex!
difference between one shot and loop!
http://nocash.emubase.de/gbatek.htm#dssound
Here apparently are the registers the sound uses, and then you can really master sound!
Another detail: (why keep it simple?)
there are two processors, the more complex examples shift the sound control to the ARM7, instead of the game which is located on the ARM9. This asks for an extra line in the makefile monster of course....more experience needed!
a link we met before does a lot of explaining, in section 4.1 - 4.4 :
http://www.fampennings.nl/maarten/nds/index.htm
But what a minute:
You can record sound, or use the microphone actively in a game!
the last links next entry is the DS Sound Capture. FUN!
(Let the player get her next levels only after shouting in the mic! )
This stays an idea for the moment!
in great nds tuto traditions, we leave the remarks on sounds in this unfinishe state!!!!