int bleep_playing = 0;
float *musicbuffer;
+
float *bleepbuffer;
+int bleepchannels;
+int bleeprate;
int musiccount;
int bleepcount;
format.byte_format = AO_FMT_NATIVE;
format.bits = 16;
- format.channels = 2;
- format.rate = SAMPLERATE;
device = NULL;
sem_wait(&audio_full); /* Wait until output buffer is full */
pthread_mutex_lock(&mutex); /* Acquire mutex */
+ format.channels = bleepchannels;
+ format.rate = bleeprate;
if (bleep_playing && device == NULL) {
device = ao_open_live(default_driver, &format, NULL);
if (device == NULL) {
frames_read = 0;
toread = sf_info.frames * sf_info.channels;
+ bleepchannels = sf_info.channels;
+ bleeprate = sf_info.samplerate;
+
bleep_playing = TRUE;
while (toread > 0) {
sem_wait(&audio_empty);