sound is coming
This commit is contained in:
джерело
094de74445
коміт
76bd00d052
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
|
||||
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "player.h"
|
||||
|
||||
|
|
Завантаження…
Посилання в новій задачі