[vorbis-dev] libao AU driver

William T. Mahan wtm2 at duke.edu
Wed May 9 21:48:37 PDT 2001



On Wed, 9 May 2001, Aaron Plattner wrote:

> Looks good to me.  The patch didn't apply quite right, but after I applied
> it by
> hand it worked fine (on Linux x86 = little-endian), although ogg123 still
>  has

Sorry, I think the patch got mangled when I pasted it into my mail 
program.  The attached one should apply cleanly against current CVS 
(using ao_au.c from my previous post).

I was only able to test the driver on little-endian as well, so I 
suppose the moment of truth will be when someone with a big-endian 
machine tries it out.

> problems playing multiple ogg files and writing to a file at the same time
> (that's not an ao_au problem)...

Hmm.... If I understand correctly, the wav and au formats assume a fixed 
number of channels and sampling rate throughout the file.  Perhaps ogg123 
should just exit with an error message when attempting to write such 
files using a file format as an output device?

Thanks,
Wil



Index: doc/DRIVERS
===================================================================
RCS file: /usr/local/cvsroot/ao/doc/DRIVERS,v
retrieving revision 1.3
diff -u -r1.3 DRIVERS
--- doc/DRIVERS	2001/05/06 00:13:58	1.3
+++ doc/DRIVERS	2001/05/10 03:04:38
@@ -72,6 +72,15 @@
                 big-endian order, and "little" for little-endian order. By
                 default this is "native".
 
+au
+--
+Sun audio file output.  Writes an au file from the audio
+data you output.
+	Option keys:
+		"file" - Sets the output file.  Use "-" to
+		write to stdout.  By default this is
+		"output.au".
+		
 ADDING NEW DRIVERS
 
 [To be written. - Stan]
Index: include/ao/ao.h
===================================================================
RCS file: /usr/local/cvsroot/ao/include/ao/ao.h,v
retrieving revision 1.12
diff -u -r1.12 ao.h
--- include/ao/ao.h	2001/05/06 00:13:59	1.12
+++ include/ao/ao.h	2001/05/10 03:04:39
@@ -76,6 +76,7 @@
 #define AO_NULL     0
 #define AO_WAV      1
 #define AO_RAW	    2
+#define AO_AU       3
 
 /* --- Functions --- */
 
Index: src/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ao/src/Makefile.am,v
retrieving revision 1.5
diff -u -r1.5 Makefile.am
--- src/Makefile.am	2001/05/06 00:13:59	1.5
+++ src/Makefile.am	2001/05/10 03:04:39
@@ -7,7 +7,7 @@
 
 lib_LTLIBRARIES = libao.la
 
-libao_la_SOURCES = audio_out.c ao_raw.c ao_wav.c ao_null.c
+libao_la_SOURCES = audio_out.c ao_au.c ao_raw.c ao_wav.c ao_null.c
 libao_la_LDFLAGS = -version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@
 
 
Index: src/audio_out.c
===================================================================
RCS file: /usr/local/cvsroot/ao/src/audio_out.c,v
retrieving revision 1.14
diff -u -r1.14 audio_out.c
--- src/audio_out.c	2001/05/06 00:13:59	1.14
+++ src/audio_out.c	2001/05/10 03:04:40
@@ -56,6 +56,7 @@
 extern ao_functions_t ao_null;
 extern ao_functions_t ao_wav;
 extern ao_functions_t ao_raw;
+extern ao_functions_t ao_au;
 
 driver_tree_t *driver_head = NULL;
 
@@ -99,6 +100,7 @@
         driver_tree_t *dnull;
         driver_tree_t *dwav;
         driver_tree_t *draw;
+	driver_tree_t *dau;
         driver_tree_t *plugin;
         driver_tree_t *driver;
         DIR *plugindir;
@@ -109,7 +111,7 @@
         char fullpath[FILENAME_MAX];
 
         if (driver_head == NULL) {
-		/* insert the null and wav drivers into the tree */
+		/* insert the null, wav, raw, and au drivers into the tree */
                 dnull = (driver_tree_t *)malloc(sizeof(driver_tree_t));
                 dnull->functions = &ao_null;
                 dnull->handle = NULL;
@@ -119,13 +121,17 @@
                 draw = (driver_tree_t *)malloc(sizeof(driver_tree_t));
                 draw->functions = &ao_raw;
                 draw->handle = NULL;
+		dau = (driver_tree_t *)malloc(sizeof(driver_tree_t));
+		dau->functions = &ao_au;
+		dau->handle = NULL;
                 
                 dnull->next = dwav;
                 dwav->next = draw;
-		draw->next = NULL;
+		draw->next = dau;
+		dau->next = NULL;
 
                 driver_head = dnull;		
-		driver = draw;
+		driver = dau;
 
                 /* now insert any plugins we find */
                 plugindir = opendir(AO_PLUGIN_PATH);
@@ -157,7 +163,7 @@
         if (!driver_head) return;
 
         /* unload and free all the plugins */
-	driver = driver->next->next->next;  /* Skip null, wav, and raw driver */
+	driver = driver->next->next->next->next; /* Skip null, wav, raw, and au drivers */
         while (driver) {
                 if (driver->functions) free(driver->functions);
                 if (driver->handle) dlclose(driver->handle);

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list