free wrapper api for xaudio 2 ?

Started by
3 comments, last by Norman Barrows 10 years, 7 months ago

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?

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

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

I've recently been working with: https://code.google.com/p/gorilla-audio/ The interface isn't quite as simple as you asked for but it's not far off either.

SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

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
 
 

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

[ 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?

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

This topic is closed to new replies.

Advertisement