Search
lxdream.org :: lxdream/src/aica/audio.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/audio.c
changeset 700:4650d0c7f6f9
prev697:479b8c213f61
next736:a02d1475ccfd
author nkeynes
date Sun Jun 22 06:49:00 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Big cleanup of the command-line options
Add an actual manpage (*gasp*)
file annotate diff log raw
1.1 --- a/src/aica/audio.c Sun Jun 22 04:01:27 2008 +0000
1.2 +++ b/src/aica/audio.c Sun Jun 22 06:49:00 2008 +0000
1.3 @@ -19,7 +19,7 @@
1.4
1.5 #include "aica/aica.h"
1.6 #include "aica/audio.h"
1.7 -#include "glib/gmem.h"
1.8 +#include <glib/gmem.h>
1.9 #include "dream.h"
1.10 #include <assert.h>
1.11 #include <string.h>
1.12 @@ -48,7 +48,7 @@
1.13 NULL };
1.14
1.15 #define NUM_BUFFERS 3
1.16 -#define MS_PER_BUFFER 1000
1.17 +#define MS_PER_BUFFER 100
1.18
1.19 #define BUFFER_EMPTY 0
1.20 #define BUFFER_WRITING 1
1.21 @@ -99,6 +99,16 @@
1.22 return NULL;
1.23 }
1.24
1.25 +void print_audio_drivers( FILE * out )
1.26 +{
1.27 + int i;
1.28 + fprintf( out, "Available audio drivers:\n" );
1.29 + for( i=0; audio_driver_list[i] != NULL; i++ ) {
1.30 + fprintf( out, " %-8s %s\n", audio_driver_list[i]->name,
1.31 + gettext(audio_driver_list[i]->description) );
1.32 + }
1.33 +}
1.34 +
1.35 audio_driver_t audio_init_driver( const char *preferred_driver )
1.36 {
1.37 audio_driver_t audio_driver = get_audio_driver_by_name(preferred_driver);
1.38 @@ -407,7 +417,7 @@
1.39 break;
1.40 }
1.41 case AUDIO_FMT_8BIT: {
1.42 - int8_t *data = (uint8_t *)&buf->data[buf->posn];
1.43 + int8_t *data = (int8_t *)&buf->data[buf->posn];
1.44 for( j=0; j < num_samples; j++ ) {
1.45 *data++ = (int8_t)(result_buf[j][0] >> 16);
1.46 *data++ = (int8_t)(result_buf[j][1] >> 16);
1.47 @@ -419,7 +429,7 @@
1.48 break;
1.49 }
1.50 buf = audio.output_buffers[audio.write_buffer];
1.51 - data = (uint8_t *)&buf->data[0];
1.52 + data = (int8_t *)&buf->data[0];
1.53 }
1.54 }
1.55 break;
.