blurpped sound, wtf ?
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
extern int verbosity;
|
||||
|
||||
#define T_BUFF_WAVES 16384
|
||||
#define T_BUFF_WAVES 16384*2
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
@@ -32,6 +32,12 @@ short *buffer;
|
||||
fprintf(stderr, ">>> %s ( '%s' %p %d )\n", __func__, fname, dev, loop);
|
||||
#endif
|
||||
|
||||
buffer = calloc(T_BUFF_WAVES, sizeof(short)*2);
|
||||
if (NULL == buffer) {
|
||||
fprintf(stderr, "ALLOC FAIL, ABEND in %s\n", __func__);
|
||||
abort();
|
||||
}
|
||||
|
||||
sndf = sf_open(fname, SFM_READ, &sfinfo);
|
||||
if (NULL==sndf)
|
||||
{
|
||||
@@ -52,16 +58,12 @@ while ((lus = sf_read_short(sndf, buffer, T_BUFF_WAVES))) {
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s : %d bytes read\n", fname, lus);
|
||||
#endif
|
||||
foo = ao_play(dev, buffer, T_BUFF_WAVES*2);
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s : %d played\n", fname, foo);
|
||||
#endif
|
||||
|
||||
ao_play(dev, buffer, lus*2);
|
||||
}
|
||||
|
||||
/* do some cleanup */
|
||||
free(buffer);
|
||||
sf_close(sndf);
|
||||
free(buffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user