stream sound[solved]

support for the gba/nds sound library from www.maxmod.org

Moderator: eKid

Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

stream sound[solved]

Post by Tomdev » Thu Mar 05, 2009 9:02 pm

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: :
Last edited by Tomdev on Sat Jul 11, 2009 7:04 pm, edited 3 times in total.

eKid
Posts: 65
Joined: Sat Dec 06, 2008 6:07 pm
Contact:

Re: streaming audio

Post by eKid » Fri Mar 06, 2009 6:59 am

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.

Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

Re: streaming audio

Post by Tomdev » Fri Mar 06, 2009 7:19 am

ok, another question then, how could i load my module files into memory to play them? :roll:

eKid
Posts: 65
Joined: Sat Dec 06, 2008 6:07 pm
Contact:

Re: streaming audio

Post by eKid » Fri Mar 06, 2009 11:39 am

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

Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

Re: streaming audio

Post by Tomdev » Fri Mar 06, 2009 6:47 pm

and could i place this soundbank on my sd card an load it?

eKid
Posts: 65
Joined: Sat Dec 06, 2008 6:07 pm
Contact:

Re: streaming audio

Post by eKid » Fri Mar 06, 2009 11:32 pm

Yes, mmInitDefault("filename") will initialize maxmod to use a soundbank on the card.

Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

Re: streaming audio

Post by Tomdev » Sat Mar 07, 2009 7:49 am

thanks ekid i'm going to test it

Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

Re: streaming audio

Post by Tomdev » Mon Mar 09, 2009 7:53 pm

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)

eKid
Posts: 65
Joined: Sat Dec 06, 2008 6:07 pm
Contact:

Re: streaming audio

Post by eKid » Tue Mar 10, 2009 12:17 pm

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).

Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

Re: streaming audio

Post by Tomdev » Fri Mar 20, 2009 8:39 pm

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?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests