For a complete list of all variables and functions in the API you should look
at the following header files:
Time when record was started. This variable contains right value only if
@@ -503,19 +503,19 @@ char *buffer;
buffer = (char *)malloc( 512 * 1024 );
if ( !buffer ) return;
-if ( (err = snd_pcm_open( &handle, card, device, SND_PCM_OPEN_PLAYBACK )) < 0 ) {
+if ( (err = snd_pcm_open( &handle, card, device, SND_PCM_OPEN_PLAYBACK )) < 0 ) {
fprintf( stderr, "open failed: %s\n", snd_strerror( err ) );
return;
}
format.format = SND_PCM_SFMT_MU_LAW;
format.rate = 8000;
-format.voices = 1;
-if ( (err = snd_pcm_playback_format( handle, &format )) < 0 ) {
+format.channels = 1;
+if ( (err = snd_pcm_playback_format( handle, &format )) < 0 ) {
fprintf( stderr, "format setup failed: %s\n", snd_strerror( err ) );
snd_pcm_close( handle );
return;
}
-fd = open( "/tmp/test.au" );
+fd = open( "/tmp/test.au", O_RDONLY );
if ( fd < 0 ) {
perror( "open file" );
snd_pcm_close( handle );
@@ -534,7 +534,7 @@ if ( !memcmp( buffer, ".snd", 4 ) ) {
if ( idx > 128 ) idx = 128;
if ( idx > count ) idx = count;
}
-size = snd_pcm_write( handle, &buffer[ idx ], count - idx );
+size = snd_pcm_write( handle, &buffer[ idx ], count - idx );
printf( "Bytes written %i from %i...\n", size, count - idx );
snd_pcm_close( handle );
free( buffer );
diff --git a/doc/soundapi.sgml b/doc/soundapi.sgml
index bf32ebc3..3d0e482d 100644
--- a/doc/soundapi.sgml
+++ b/doc/soundapi.sgml
@@ -35,9 +35,9 @@ may be placed in the library code instead of the kernel driver.
For a complete list of all variables and functions in the API you should look
at the following header files:
- - /usr/include/sys/soundlib.h
-
- /usr/include/linux/sound.h
-
- /usr/include/linux/sounddetect.h
+
- /usr/include/sys/asoundlib.h
+
- /usr/include/linux/asound.h
+
- /usr/include/linux/asoundid.h
Error Codes
@@ -922,13 +922,13 @@ if ( (err = snd_pcm_open( &ero;handle, card, device, SND_PCM_OPEN_PLAYBACK )) <
}
format.format = SND_PCM_SFMT_MU_LAW;
format.rate = 8000;
-format.voices = 1;
+format.channels = 1;
if ( (err = snd_pcm_playback_format( handle, &ero;format )) < 0 ) {
fprintf( stderr, "format setup failed: %s\n", snd_strerror( err ) );
snd_pcm_close( handle );
return;
}
-fd = open( "/tmp/test.au" );
+fd = open( "/tmp/test.au", O_RDONLY );
if ( fd < 0 ) {
perror( "open file" );
snd_pcm_close( handle );
diff --git a/doc/soundapi.txt b/doc/soundapi.txt
index ebe5d45f..037de813 100644
--- a/doc/soundapi.txt
+++ b/doc/soundapi.txt
@@ -163,11 +163,11 @@
For a complete list of all variables and functions in the API you
should look at the following header files:
- 1. /usr/include/sys/soundlib.h
+ 1. /usr/include/sys/asoundlib.h
- 2. /usr/include/linux/sound.h
+ 2. /usr/include/linux/asound.h
- 3. /usr/include/linux/sounddetect.h
+ 3. /usr/include/linux/asoundid.h
22.. EErrrroorr CCooddeess
@@ -1197,13 +1197,13 @@
}
format.format = SND_PCM_SFMT_MU_LAW;
format.rate = 8000;
- format.voices = 1;
+ format.channels = 1;
if ( (err = snd_pcm_playback_format( handle, &format )) < 0 ) {
fprintf( stderr, "format setup failed: %s\n", snd_strerror( err ) );
snd_pcm_close( handle );
return;
}
- fd = open( "/tmp/test.au" );
+ fd = open( "/tmp/test.au", O_RDONLY );
if ( fd < 0 ) {
perror( "open file" );
snd_pcm_close( handle );
diff --git a/include/header.h b/include/header.h
index 3bf18124..7261c011 100644
--- a/include/header.h
+++ b/include/header.h
@@ -22,7 +22,7 @@
#ifndef __SOUNDLIB_H
#define __SOUNDLIB_H
-#include
+#include
#include
#include
diff --git a/src/Makefile b/src/Makefile
index 166426ca..42740fe1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -5,10 +5,10 @@
include ../Makefile.conf
-TARGET=../lib/libsound.a
-STARGET=../lib/libsound.so
-STARGETX=../lib/libsound.so.$(SND_LIB_VERSION)
-STARGETO=../lib/libsound.so.$(SND_LIB_MAJOR)
+TARGET=../lib/libasound.a
+STARGET=../lib/libasound.so
+STARGETX=../lib/libasound.so.$(SND_LIB_VERSION)
+STARGETO=../lib/libasound.so.$(SND_LIB_MAJOR)
TARGETS=$(TARGET) $(STARGET)
STATIC_LIBS= control/libcontrol.a \
@@ -34,14 +34,14 @@ SOBJECTS=error.So
all: $(TARGETS)
$(TARGET): .depend $(OBJECTS) $(STATIC_LIBS)
- rm -f ../lib/libsound.a
+ rm -f ../lib/libasound.a
$(LINKER) -r -o $(TARGET) $(STATIC_LIBS) $(OBJECTS)
$(STARGET): .depend $(SOBJECTS) $(DYNAMIC_LIBS)
- rm -f ../lib/libsound*.so*
- $(CC) -shared -Wl,-soname,libsound.so.$(SND_LIB_MAJOR) $(DYNAMIC_LIBS) $(SOBJECTS) -o $(STARGETX)
- ln -s libsound.so.$(SND_LIB_VERSION) $(STARGET)
- ln -s libsound.so.$(SND_LIB_VERSION) $(STARGETO)
+ rm -f ../lib/libasound*.so*
+ $(CC) -shared -Wl,-soname,libasound.so.$(SND_LIB_MAJOR) $(DYNAMIC_LIBS) $(SOBJECTS) -o $(STARGETX)
+ ln -s libasound.so.$(SND_LIB_VERSION) $(STARGET)
+ ln -s libasound.so.$(SND_LIB_VERSION) $(STARGETO)
control/libcontrol.a:
$(MAKE) -C control
@@ -69,7 +69,7 @@ clean:
$(MAKE) -C mixer clean
$(MAKE) -C rawmidi clean
rm -f core .depend *.o *.So *.orig *~
- rm -f ../lib/libsound.*
+ rm -f ../lib/libasound.*
.depend:
$(CPP) $(COPTS) $(INCLUDE) -M *.c > .depend
diff --git a/src/control/cards.c b/src/control/cards.c
index 413cb743..c7a8da27 100644
--- a/src/control/cards.c
+++ b/src/control/cards.c
@@ -26,7 +26,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
#define SND_FILE_CONTROL "/dev/sndcontrol%i"
diff --git a/src/control/control.c b/src/control/control.c
index 2e98b3df..b5912324 100644
--- a/src/control/control.c
+++ b/src/control/control.c
@@ -26,7 +26,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
#define SND_FILE_CONTROL "/dev/snd/control%i"
#define SND_CTL_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 )
diff --git a/src/error.c b/src/error.c
index 217a86d5..387d6da7 100644
--- a/src/error.c
+++ b/src/error.c
@@ -24,7 +24,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
static const char *snd_error_codes[] = {
"Sound protocol isn't compatible"
diff --git a/src/mixer/mixer.c b/src/mixer/mixer.c
index 430a133c..f385bc99 100644
--- a/src/mixer/mixer.c
+++ b/src/mixer/mixer.c
@@ -26,7 +26,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
#define SND_FILE_MIXER "/dev/snd/mixer%i%i"
#define SND_MIXER_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 1 )
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 15c5d9ed..5557f13b 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -26,7 +26,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
#define SND_FILE_PCM "/dev/snd/pcm%i%i"
#define SND_PCM_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 )
diff --git a/src/rawmidi/rawmidi.c b/src/rawmidi/rawmidi.c
index 016541e6..6a3b46ec 100644
--- a/src/rawmidi/rawmidi.c
+++ b/src/rawmidi/rawmidi.c
@@ -26,7 +26,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
#define SND_FILE_RAWMIDI "/dev/snd/midi%i%i"
#define SND_PCM_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 )
diff --git a/test/control.c b/test/control.c
index fa6e7502..e7f93119 100644
--- a/test/control.c
+++ b/test/control.c
@@ -1,6 +1,6 @@
#include
#include
-#include "../include/soundlib.h"
+#include "../include/asoundlib.h"
void main( void )
{
diff --git a/test/mixer.c b/test/mixer.c
index 6ef0f30b..1ab3e803 100644
--- a/test/mixer.c
+++ b/test/mixer.c
@@ -1,6 +1,6 @@
#include
#include
-#include "../include/soundlib.h"
+#include "../include/asoundlib.h"
static void mixer_test( int card, int device )
{
diff --git a/test/switches.c b/test/switches.c
index f8992c28..334e2baa 100644
--- a/test/switches.c
+++ b/test/switches.c
@@ -1,6 +1,6 @@
#include
#include
-#include "../include/soundlib.h"
+#include "../include/asoundlib.h"
const char *get_type( unsigned int type )
{