diff --git a/audio/player.c b/audio/player.c index 82e7821..b0522ea 100644 --- a/audio/player.c +++ b/audio/player.c @@ -74,25 +74,29 @@ fprintf(stderr, "frames : %ld\n", sfinfo.frames); fprintf(stderr, "seekable : %d\n", sfinfo.seekable); #endif +foo = init_waveout(sfinfo.samplerate); +if (foo) { + fprintf(stderr, "init waveout -> %d\n", foo); + } + while ((lus = sf_read_short(sndf, buffer, T_BUFF_WAVES))) { #if DEBUG_LEVEL fprintf(stderr, "%s : %d bytes read\n", fname, lus); #endif - - + /* send all the bits to the audio output */ + foo = ao_play(device, (char *)buffer, lus*2); + if (foo) { + fprintf(stderr, "ao_play -> %d\n", foo); + } } /* do some cleanup */ +close_waveout(); sf_close(sndf); -return -1; +return 0; } - /* --------------------------------------------------------------------- */ - - - - /* --------------------------------------------------------------------- */ diff --git a/audio/t.c b/audio/t.c index ac4f071..f69f2d8 100644 --- a/audio/t.c +++ b/audio/t.c @@ -3,7 +3,7 @@ */ #include - +#include #include "player.h"