#58187 - inferno - Fri Oct 21, 2005 3:51 pm
Hi all!
I suppose this question must have been asked several times before but searching this forum didn't really help me, so:
While converting my .wav to .raw and playing it on my DS (using the GBFS) the only thing I hear is white noise :O. The file itself is a 44100hz mono 16bit pcm file (from the top of my head)... Why is it screwed up once I play it?
What programs do you use for saving and editing .wav? Audacity is a great program, but if it continues giving these errors once converted to raw, I really must look at using another program.
Thanks in advance!
_________________
The absurdest thing I've ever heard is that this world is not absurd.
#58190 - Onori - Fri Oct 21, 2005 3:54 pm
the file must be in signed form, wav file are unsigned :/
I use this function to convert on the DS:
Code: |
void ConvertUnsignedToSigned(u8 *buf, u16 taille)
{
while (taille--)
{
*buf = (*buf) - 128;
buf++;
}
} |
and to play file I use:
#define PLAY_SOUND(_A_) playGenericSound(_A_, sizeof(_A_))
but it must be in 8bits mono 11025Hz
#58195 - inferno - Fri Oct 21, 2005 4:03 pm
I use sox to convert it, but it still doesn't work. I've seen demos running 44100hz, though.
_________________
The absurdest thing I've ever heard is that this world is not absurd.
#58197 - inferno - Fri Oct 21, 2005 4:09 pm
I'm referring to the Tickle Girl demo btw.. I'll post some code:
Code: |
static SoundFile soundFiles[] = {
{ "bgm.raw", "BGM", 22050, 0, 0 }
{ 0,0,0,0,0 }
};
|
To declare the background music and other sfx
Code: |
static uint8* sound_buffer = 0;
static uint8* bgm_buffer = 0;
static SoundFile* current_sound_file = 0;
static unsigned int current_sound_channel = 0; |
buffers etc. and more code not relevant atm
Code: |
current_sound_file = &soundFiles[SFX_BGM];
dmaCopy(current_sound_file->data, bgm_buffer, current_sound_file->length);
CommandPlaySampleLoop(current_sound_channel, current_sound_file->frequency, bgm_buffer, current_sound_file->length, 0x7F);
// switch to next channel to allow SFX to play over BGM
++current_sound_channel; |
to play the music.
Works fine in the .raw of the bgm music in tickle girl. But my converted file with the same settings doesn't work =(.
_________________
The absurdest thing I've ever heard is that this world is not absurd.
#58200 - tepples - Fri Oct 21, 2005 4:19 pm
16-bit PCM is little-endian and signed, even in .wav format. Only 8-bit PCM is unsigned in .wav format.
Have you tried 8-bit sound first? You can use .wav files directly if you flip the sign bit of each sample (*dst ^= 0x80;) after loading them into RAM.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
Last edited by tepples on Fri Oct 21, 2005 8:20 pm; edited 1 time in total
#58208 - inferno - Fri Oct 21, 2005 4:55 pm
tepples wrote: |
16-bit PCM is little-endian and signed, even in .wav format. Only 8-bit PCM is unsigned in .wav format.
Have you tried 8-bit sound first? You can use .wav files directly if you flip the sign bit (*dst ^= 0x80;) after loading them into RAM. |
Great... I'll try it!
_________________
The absurdest thing I've ever heard is that this world is not absurd.
#58410 - inferno - Sun Oct 23, 2005 10:48 am
Hmm.. Audacity isn't able to fully save in 8-bit format. Only 16-bit is supported. Any programs you use to do this?
_________________
The absurdest thing I've ever heard is that this world is not absurd.
#58429 - tepples - Sun Oct 23, 2005 3:46 pm
I've been using Cool Edit Pro, but if you want a program that will take a 16-bit PCM file and convert it to 8-bit, I could probably whip one up.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#58452 - inferno - Sun Oct 23, 2005 7:30 pm
Okay guys, it worked!
So for future questions concerning this: this was my solution:
Audacity is one of the best free editors around. It usually works with 16-bit+ files, but the internal codecs provide a solution for this problem.
First of all if you have a clip in stereo, put it in mono
(open the menu of the audio clip and select "Split stereo track", now close the left or right channel (check which one sounds best) open the menu of this channel and click on "mono")
Edit the file to your needs. After that, open file>preferences. Go to file formats and in the drop-down menu choose as "Uncompressed Export Format": AIFF (Apple/Sgi), signed 8 bit PCM. Jup I know about signed or unsigned file formats, but just use that one... It is the only one compatible with the Nintendo DS.
Export the file. You can choose the sample rate yourself... I usually go with 44100hz.
This might sound like a n00bish tutorial. Jup, it is, but figuring this out helped me a lot so for those struggling with Audacity: here you go.
_________________
The absurdest thing I've ever heard is that this world is not absurd.
#149373 - mud2005 - Sat Jan 19, 2008 10:26 am
I got audacity to finally work also , except when saving I chose
Format: other
Header: RAW(header-less)
Encoding: signed 8 bit PCM
this way I was able to save as a raw file. seems to work ok so far :)
#149376 - Cid2Mizard - Sat Jan 19, 2008 11:49 am
i used Switch :
-Format : 8 bit signed
-Sample Rate : 11025
-Channels : mono
The sound is perfect on DS
_________________
www.nintendomax.com 100% Hack 0% Warez