Dsaudio

From ProjectWiki
(Difference between revisions)
Jump to: navigation, search
(Functions)
(yHyjyzZdcO)
Line 1: Line 1:
<big>Stuff I'd like to see in the libnds audio implementation</big>
+
Your potnsig really straightened me out. Thanks!
__TOC__
+
<big>Project Status: Drawing board</big>
+
 
+
== Introduction ==
+
 
+
The current libnds audio implementation lacks well most everything. There are only three audio related functions.
+
 
+
This page is for considering what would be the best way to implement full featured audio functionality that makes full use of the DS's wonderful audio hardware and what features would best serve everyone's needs without adding unnecessary bloat to support rarely used functions while hopefully not preventing a developer from adding these features later (without them modifying arm7 code preferably).
+
 
+
Objective of the project overall is to make useful an extensible high quality developer friendly audio library available for DS homebrew... Because, like others, ''need'' or otherwise would like it for my game!!!!! :p
+
 
+
Feel free to comment or [[Talk:Dsaudio|discuss]] concerns or give feedback such as "I'll never use this bit and don't see why anyone else would either", or "I really need this useful feature that can be useful to others.", or anything that comes to mind.
+
 
+
What is here so far is based on discussions [[#References/External Links|on irc]], various libnds and hardware docs on the web [[#References/External Links|like these]].
+
 
+
Now I'm like, well duh! Truly thanukfl for your help.
+
 
+
== Todo ==
+
Pretty much everything! But more specifically:
+
* Create some type of generalized overview of the complete system
+
* Document/define structures, and types for lib specific return values
+
* Otherwise improve documentation in general
+
* Tho a lot of it is self evident, still need to work out the arm7 side enough to assist in defining an efficient scheme for communication (utilizing the newly added FIFO functionality) between the arm7 and arm9.
+
 
+
Whoeevr edits and publishes these articles really knows what they're doing.
+
 
+
== Defines, Globals, and Structures ==
+
 
+
== Usage Examples ==
+
''' Simplest sample playback scenario '''
+
mmSoundInit(); //Initalize sound lib and set default params (22050khz, PCM8, no loop, mono)
+
mmSamplePlay(mmSampleSimpleLoad((void *)mysample_raw, mysample_len));
+
 
+
Okai, mmSoundInit(); must be called at least once for everything else so im not gonna bother putting in further examples
+
 
+
''' Playing a 44100khz 16bit sample and stopping it after a little bit '''
+
u16 testsample=mmSampleLoad((void *)mysample_raw, mysample_len, NULL, 44100, 127, 64, MMFLAGS_PCM16);
+
mmSamplePlay(testsample);
+
msleep(20000);
+
mmSampleStop(testsample);
+
 
+
''' Playing a sample from filesystem using the default rate/vol/pan/flags '''
+
u16 testsample=mmSampleSimpleLoadFile("/pathto/mysample.raw");
+
mmSamplePlay(testsample);
+
 
+
''' Reusing the same hardware channel to retrig same sample '''
+
u16 testsample=mmSampleSimpleLoad((void*)mysample_raw,mysample_len);
+
u8 samplechan=mmSamplePlay(testsample);
+
doSomethingForABit();
+
mmChanSamplePlay(samplechan,testsample); //reuse same channel
+
 
+
Alternate way to do sorta same thing, in this case make a imaginary spaceship's laser firing noise:
+
u16 shipshootsample=mmSampleSimpleLoad((void*)mysample_raw,mysample_len);
+
u8 shipshootchannel=mmChanGet(MMGET_ANY); //Get an unused sample channel
+
mmChanSetFlags(MMFLAGS_STICKY); //optional, used to indicate this channel shouldnt be dynamically allocated to other sounds
+
while(1) {
+
  if(shipgotshot) {
+
  mmChanSamplePlay(shipshootchannel,shipshootsample);
+
  }
+
};
+
 
+
== References/External Links ==
+
Hardware references and other DS audio libraries<br />
+
[http://ekid.nintendev.com/sekrit/reference.htm Maxmod library] It would be nice if this was merged or at least compatible with eKids's project.<br />
+
[http://nocash.emubase.de/gbatek.htm#dssound gbatek sound]<br />
+
[http://neimod.com/dstek/ neimod]<br />
+
[http://blitzed.org #dsdev@irc.blitzed.org]
+
 
+
== Example Header ==
+
[[Dsaudio:Example_header|Mostly useless outdated header example can be found here.]] Original notes related to implementing an audio library written in .c syntax. This wiki page represents a more refined version of these header notes.
+
 
+
[[Category:NDS]]
+

Revision as of 11:57, 6 January 2012

Your potnsig really straightened me out. Thanks!

Personal tools
irssi scripts
eggdrop scripts