Jump to content
  • Advertisement
Sign in to follow this  
Norman Barrows

free wrapper api for xaudio 2 ?

This topic is 2126 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

is there a free wrapper api for xaudio 2 that provide an api similar to the following?

 

 

 
init_audio()
 
id = loadwav(filename)
 
playwav(id)
 
stopwav(id)
 
loopwav(id)
 
is_playing(id)
 
unload_wav(id)
 
uninit_audio()
 

 

 

i've started implementing sound, and the first line of code is "CoInitailzeEx"

 

i'm sick of wrapping obtuse MS api's in user friendly api's. is there one out there already?

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
Advertisement

microsoft made one called xAct

 

but it's not as "user-friendly" as the interface you'd like, cos you first need to create wavebank files

 

 

if you look for a very very user friendly api, SDL 2.0 now uses directx on windows

Edited by punkcoders

Share this post


Link to post
Share on other sites

Sorry guys, beat you to the punch.

 

Wrote one last night:

 

 
 
 
 
#ifndef zaudio_h
#define zaudio_h
 
 
void Zunpause_voice(int i);    // i is voice #
 
void Zpause_voice(int i); // i is voice #
 
void Zshutdown_audio();
 
//  returns: Zvoice # on success. -1=create source voice error. -2=submit source buffer error. -3=start voice error.
int Zloopwav(int i);     
 
int Zvoice_is_playing(int i);    // returns: 0=no. 1=yes.
 
 
void Zstop_voice(int i); //     i is voice #   
 
//  returns: Zvoice # on success. -1=create source voice error. -2=submit source buffer error. -3=start voice error.
int Zplaywav(int i);
 
 
// loads wav into slot i.  s is filename.
//   returns: 0=success. 1=open wav error. 2=read wav error.
int Zloadwav(int i,char *s);
 
//   returns: 0=success. 1=Xaudio2 create error. 2=create master voice error.
int Zinit_audio();
 
 
void Zloadwavs(char *s2);
 
void Zdestroy_finished_voices();
 
 
 
 
#endif
 
 

Share this post


Link to post
Share on other sites

 [ slash code ] cliped the rest of the post below the code again!

 

i'm sick of losing posts due to [ kode ] not working!

 

if this keeps up, i'm going back to blue comic ms!  <just kidding - how about pink comic ms ?>

 

briefly:  it could be cleaned up a bit internally.   remove dependencies on my z3d library for error messages, and winmm for loading files.    encapsulate in an object.    make maxwavs and maxvoices dynamic, not static.  Xaudio2 design requires one call per frame to shutdown finished voices, no workaround for that.

 

think anyone would be interested in source code?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!