diff --git a/doc/DRIVERS b/doc/DRIVERS index a4f8db18db31e866559b454d5911d0d214427b35..e12b6128347d8aee88a5d153b3b4e14bc1cacb8a 100644 --- a/doc/DRIVERS +++ b/doc/DRIVERS @@ -59,6 +59,18 @@ data you output. "file" - Sets the output file. By default, this is "output.wav". +raw +--- +Raw sample output. Writes the sound data to disk in uncompressed, +headerless form using the byte order specified. + Option keys: + "file" - Sets the output file. Use "-" if you want to write + to stdout. By default this is "output.raw". + + "byteorder" - Sets the byte order used in the output. Use + "native" for native machine byte order, "big" for + big-endian order, and "little" for little-endian order. By + default this is "native". ADDING NEW DRIVERS diff --git a/include/ao/ao.h b/include/ao/ao.h index 4311b0f6b17cb7e25f3b93732bb301737c441929..b4de0fe5188ec4d0b75401bbc99941865e6ed8b3 100644 --- a/include/ao/ao.h +++ b/include/ao/ao.h @@ -75,6 +75,7 @@ typedef struct ao_device_s { #define AO_NULL 0 #define AO_WAV 1 +#define AO_RAW 2 /* --- Functions --- */ diff --git a/src/Makefile.am b/src/Makefile.am index e12d5a0922411a2ed5d05a7d51cf92f03a1dab61..034c454d505bbb2a1250224b4b830712e9a2703b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,7 +7,7 @@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/include lib_LTLIBRARIES = libao.la -libao_la_SOURCES = audio_out.c ao_wav.c ao_null.c +libao_la_SOURCES = audio_out.c ao_raw.c ao_wav.c ao_null.c libao_la_LDFLAGS = -version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@ diff --git a/src/audio_out.c b/src/audio_out.c index 65597496d18aa623dd48f597abd1c8ae35b719be..2bda2d5d473eeb7084ba35abfde50f3fad6b63b0 100644 --- a/src/audio_out.c +++ b/src/audio_out.c @@ -55,6 +55,7 @@ typedef struct driver_tree_s { extern ao_functions_t ao_null; extern ao_functions_t ao_wav; +extern ao_functions_t ao_raw; driver_tree_t *driver_head = NULL; @@ -97,6 +98,7 @@ void ao_initialize(void) { driver_tree_t *dnull; driver_tree_t *dwav; + driver_tree_t *draw; driver_tree_t *plugin; driver_tree_t *driver; DIR *plugindir; @@ -114,12 +116,16 @@ void ao_initialize(void) dwav = (driver_tree_t *)malloc(sizeof(driver_tree_t)); dwav->functions = &ao_wav; dwav->handle = NULL; + draw = (driver_tree_t *)malloc(sizeof(driver_tree_t)); + draw->functions = &ao_raw; + draw->handle = NULL; dnull->next = dwav; - dwav->next = NULL; + dwav->next = draw; + draw->next = NULL; driver_head = dnull; - driver = dwav; + driver = draw; /* now insert any plugins we find */ plugindir = opendir(AO_PLUGIN_PATH); @@ -151,7 +157,7 @@ void ao_shutdown(void) if (!driver_head) return; /* unload and free all the plugins */ - driver = driver->next->next; + driver = driver->next->next->next; /* Skip null, wav, and raw driver */ while (driver) { if (driver->functions) free(driver->functions); if (driver->handle) dlclose(driver->handle);