Using Xenos Sound Driver ?

Ask/talk about LibXenon Development/Compiling
Post Reply

Using Xenos Sound Driver ?

Post by shortstop » Sun Jan 20, 2013 5:41 pm

I just would like to play simple fx sounds and musics in my homebrew game.
I am not able to find an example or tutorial on using the xenon_sound driver.

Here follows the code i use today ( copy from the megadrive emulator sound engine found by googling ).

Code: Select all

#include <xenon_sound/sound.h>
if ( xenon_sound_get_unplayed() > 0 )   {  // attends que ce soit libre }
else   { xenon_sound_submit( pcm_data, pcm_length );  }
For my first test, the buffer array "pcm_data" and its size "pcm_length" were obtained by using a command line : "raw2c.exe sfx.wav" with a sound wav file. As expected, i obtain a sound but not the good one so i have made some mistake !!

Question : How to make it work ? Do i just have to transform my wav file in a RAW PCM format with special frequency and bit rate  ?

Thank you for your help.
Last edited by shortstop on Sun Jan 20, 2013 5:43 pm, edited 1 time in total.

Posts: 74
Joined: Tue Mar 15, 2011 2:20 pm

Re: Using Xenos Sound Driver ?

Post by Ced2911 » Tue Jan 22, 2013 2:52 pm

the sound must use the good format,

from: ... sound.h#L8

48khz, signed 16bit stereo.

you must stream the sound if the length is big

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests