Page 1 of 3

stream sound[solved]

Posted: Thu Mar 05, 2009 9:02 pm
by Tomdev
ok i tried to get streaming working but I'm stuck with updating a stream. how do i do that. say i'm reading a mod file from fat into a buffer, how could i get sound out my ds? i really have no idea how to do this with the update stream function :oops: :

Re: streaming audio

Posted: Fri Mar 06, 2009 6:59 am
by eKid
The streaming functions are meant for passing raw audio data to the DS sound output. MOD files don't contain a raw stream of audio, but rather a small set of samples and some data containing info on how to play the sounds in a sequence (maxmod has other routines to play MOD files).

There is a streaming example in the devkitPro examples that shows how to open an audio stream and feed it a synthensized sound.

Re: streaming audio

Posted: Fri Mar 06, 2009 7:19 am
by Tomdev
ok, another question then, how could i load my module files into memory to play them? :roll:

Re: streaming audio

Posted: Fri Mar 06, 2009 11:39 am
by eKid
First the module must be preconverted with the maxmod utility (mmutil), the utility puts all of your modules and sounds into one 'soundbank' file. This file can be used with maxmod so that you can then 'mmLoad' the song into memory and then 'mmStart' start playback.

http://www.maxmod.org/ref/tut/convguide.html - a guide on using mmutil
http://www.maxmod.org/ref/tut/dsprog.html - a guide on using maxmod for music and sound

Re: streaming audio

Posted: Fri Mar 06, 2009 6:47 pm
by Tomdev
and could i place this soundbank on my sd card an load it?

Re: streaming audio

Posted: Fri Mar 06, 2009 11:32 pm
by eKid
Yes, mmInitDefault("filename") will initialize maxmod to use a soundbank on the card.

Re: streaming audio

Posted: Sat Mar 07, 2009 7:49 am
by Tomdev
thanks ekid i'm going to test it

Re: streaming audio

Posted: Mon Mar 09, 2009 7:53 pm
by Tomdev
and if i say this mmInitDefault("sound/soundbank.bin") will this work? and if so, does it load the whole soundbank into memory(that's why i want it to load from fat)

Re: streaming audio

Posted: Tue Mar 10, 2009 12:17 pm
by eKid
No, with this setup only the things that you load will be in memory (mmLoad/mmLoadEffect). You can also set it up where the soundbank is linked in with the program, so everything will already be in memory (although you still need to use mmLoad/Effect).

Re: streaming audio

Posted: Fri Mar 20, 2009 8:39 pm
by Tomdev
sorry so saying i have converted a soundbank and put it on my card(not in the rom) do i have to use a header file or can i just load the soundbank and load the modules?