X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dos_auplay;a=blobdiff_plain;f=src%2Faudio.c;h=51a3521b8e6740fdb50c0cc34dc62e60fd56a9c0;hp=88b84005d3a66f81368386a61f1e7f360e10fc97;hb=49ef4e243def029b7e68bf92141acbeac600e1e8;hpb=869f6c1ab78d6e2888bb008b3bd8604714f5151a diff --git a/src/audio.c b/src/audio.c index 88b8400..51a3521 100644 --- a/src/audio.c +++ b/src/audio.c @@ -17,7 +17,7 @@ static struct audrv drv; static audio_callback_func cbfunc; static void *cbcls; -void audio_init(void) +int audio_init(void) { if(sb_detect()) { drv.get_buffer = sb_buffer; @@ -27,10 +27,11 @@ void audio_init(void) drv.stop = sb_stop; drv.volume = sb_volume; drv.isplaying = sb_isplaying; - return; + return 0; } - printf("No supported audio device detected\n"); + fprintf(stderr, "No supported audio device detected\n"); + return -1; } void audio_set_callback(audio_callback_func func, void *cls) @@ -49,6 +50,7 @@ int audio_callback(void *buf, int sz) void audio_play(int rate, int bits, int nchan) { + printf("play %d samples/s, %d bits, %s\n", rate, bits, nchan == 1 ? "mono" : "stereo"); drv.start(rate, bits, nchan); }