#158263 - ZeroSum - Sun Jun 08, 2008 1:30 pm
Hi again, I'm trying to play sounds using libnds but am having some trouble playing them correctly. The SimpleSound example works great but using the example code and raw's in my own code everything sounds extremely 'tinny' and distorted. I've been searching around but keep getting contradictory information.
1. What is the 'correct' format for my own simple sound effects (1-2 second wav's)? So far I'm converting to 11025hz, 8bit, signed raw files using SoX.
2. How do I get the makefile to convert the .raw's to .o for me? I've added (copied from the SimpleSound example makefile):
to the makefile and made sure the raw was in the data dir but it seems to do nothing. I'm rather new to makefiles so I'm guessing I've missed something. I've just been renaming the .raw to a .bin but would prefer not to have to do that.
3. The code I'm using to play sounds is just like from the example:
I'm using the default arm7 code and devkitPro r23b. Have I (again) missed something which is why everything sounds distorted? Both my own raw's and the example ones both sound wrong.
Thanks for reading.
1. What is the 'correct' format for my own simple sound effects (1-2 second wav's)? So far I'm converting to 11025hz, 8bit, signed raw files using SoX.
2. How do I get the makefile to convert the .raw's to .o for me? I've added (copied from the SimpleSound example makefile):
Code: |
#---------------------------------------------------------------------------------
%.raw.o : %.raw #--------------------------------------------------------------------------------- @echo $(notdir $<) @$(bin2o) |
to the makefile and made sure the raw was in the data dir but it seems to do nothing. I'm rather new to makefiles so I'm guessing I've missed something. I've just been renaming the .raw to a .bin but would prefer not to have to do that.
3. The code I'm using to play sounds is just like from the example:
Code: |
TransferSoundData blaster = { blaster_bin, /* Sample address */ blaster_bin_size, /* Sample length */ 11025, /* Sample rate */ 127, /* Volume */ 64, /* panning */ 1 /* format */ }; playSound(&blaster); |
I'm using the default arm7 code and devkitPro r23b. Have I (again) missed something which is why everything sounds distorted? Both my own raw's and the example ones both sound wrong.
Thanks for reading.