sound is coming

This commit is contained in:
phyto 2019-05-27 15:15:48 +02:00
parent 094de74445
commit 76bd00d052
2 changed files with 13 additions and 9 deletions

View File

@ -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;
}
/* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */

View File

@ -3,7 +3,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include "player.h"