Welcome! Log In Create A New Profile

Advanced

Question about audio

Posted by ShinCrusader 
Question about audio
April 27, 2010 05:50AM
So, I was working on getting sound working in my game. I already have asndlib working fine, but the hitch is converting my .wav and .ogg files to the right format so they'll play.

For the record, I used sox to convert them with the command-line found on the asndlib wiki page:
sox input.wav -t raw -b 16 --endian big -c 2 output.raw

After initializing the ASND system and error checking, the .raw files seem to load fine (buffers apparently full with no errors), but I get complete silence when actually playing them.

Here's the code snippet I use to play a "blip" sound when the user scrolls through the options:
if(ASND_SetVoice(SELECT, VOICE_STEREO_16BIT,8000,0,samples[SELECT],sampleSizes[SELECT], 255, 255, NULL) == SND_INVALID)
{
	errmess = "Cannot play sound";
}

As far as I see, there's no error message, but no sound either. I searched the forums for a while over this and got stumped. Any tips you guys could give me for working with audio, or maybe even converting .wav files to work with the Wii?
Re: Question about audio
April 27, 2010 06:14PM
why you not put the sound in mp3 ?

sorry for the image in French







#include "sample_mp3.h"



next

/* Initialize the audio subsystem*/
ASND_Init(NULL);
MP3Player_Init();



Finally, we must add the following line to the desired location for the "music" that you added this gets under way

MP3Player_PlayBuffer(sample_mp3, sample_mp3_size, NULL);







Edited 4 time(s). Last edit at 04/27/2010 06:27PM by ketufe.
Re: Question about audio
April 27, 2010 08:17PM
ShinCrusader, maybe this post could help you: [forum.wiibrew.org]
Question about audio *RESOLVED*
April 28, 2010 05:10AM
Welp, turns out it was two things:

1) I used GoldWave to convert the audio to 16-bit big-endian mono .snd files.
2) For some reason, ASND was paused by default. Is that normal?!

The sound works nicely now, though. Set the Hz at 44100 and it plays perfectly! :D

Thanks for your help, guys!
Sorry, only registered users may post in this forum.

Click here to login