Big renaming - from sound to asound...

This commit is contained in:
Jaroslav Kysela 1998-08-30 21:08:44 +00:00
parent 254d52fc84
commit 2ae16fb30d
20 changed files with 59 additions and 57 deletions

View file

@ -20,9 +20,9 @@ may be placed in the library code instead of the kernel driver.</P>
<P>For a complete list of all variables and functions in the API you should look
at the following header files:
<OL>
<LI>/usr/include/sys/soundlib.h</LI>
<LI>/usr/include/linux/sound.h</LI>
<LI>/usr/include/linux/sounddetect.h</LI>
<LI>/usr/include/sys/asoundlib.h</LI>
<LI>/usr/include/linux/asound.h</LI>
<LI>/usr/include/linux/asoundid.h</LI>
</OL>
</P>

View file

@ -134,11 +134,11 @@ int card = 0, err;
void *handle;
stuct snd_ctl_hw_info info;
if ( (err = snd_ctl_open( &amp;handle, card )) &lt; 0 ) {
if ( (err = snd_ctl_open( &handle, card )) &lt; 0 ) {
fprintf( stderr, &quot;open failed: %s\n&quot;, snd_strerror( err ) );
return;
}
if ( (err = snd_ctl_hw_info( handle, &amp;info )) &lt; 0 ) {
if ( (err = snd_ctl_hw_info( handle, &info )) &lt; 0 ) {
fprintf( stderr, &quot;hw info failed: %s\n&quot;, snd_strerror( err ) );
snd_ctl_close( handle );
return;

View file

@ -228,11 +228,11 @@ void *handle;
snd_mixer_info_t info;
snd_mixer_channel_t channel;
if ( (err = snd_mixer_open( &amp;handle, card, device )) &lt; 0 ) {
if ( (err = snd_mixer_open( &handle, card, device )) &lt; 0 ) {
fprintf( stderr, &quot;open failed: %s\n&quot;, snd_strerror( err ) );
return;
}
if ( (err = snd_mixer_info( handle, &amp;info )) &lt; 0 ) {
if ( (err = snd_mixer_info( handle, &info )) &lt; 0 ) {
fprintf( stderr, &quot;info failed: %s\n&quot;, snd_strerror( err ) );
snd_mixer_close( handle );
return;
@ -241,13 +241,13 @@ printf( &quot;Installed MIXER channels for card #i and device %i: %i\n&quot;,
card + 1, device, info.channels );
master = snd_mixer_channel( handle, SND_MIXER_ID_MASTER );
if ( master &gt;= 0 ) {
if ( (err = snd_mixer_read( handle, master, &amp;channel )) &lt; 0 ) {
if ( (err = snd_mixer_read( handle, master, &channel )) &lt; 0 ) {
fprintf( stderr, &quot;master read failed: %s\n&quot;, snd_strerror( err ) );
snd_mixer_close( handle );
return;
}
channel -&gt; left = channel -&gt; right = 50;
if ( (err = snd_mixer_write( handle, master, &amp;channel )) &lt; 0 ) {
if ( (err = snd_mixer_write( handle, master, &channel )) &lt; 0 ) {
fprintf( stderr, &quot;master write failed: %s\n&quot;, snd_strerror( err ) );
snd_mixer_close( handle );
return;

View file

@ -394,7 +394,7 @@ should not be equal to <I>count</I>.</P>
of <I>snd_pcm_playback_status</I>.</P>
<DT><B>time</B><DD><P>Delay till played of the first sample from next write. This value should
be used for time synchronization. Returned value is in the same format as
returned from the standard C function <I>gettimeofday( &amp;time, NULL )</I>.
returned from the standard C function <I>gettimeofday( &time, NULL )</I>.
This variable contains right value only if playback time mode is enabled
(look to <I>snd_pcm_playback_time</I> function).</P>
<DT><B>stime</B><DD><P>Time when playback was started.
@ -434,7 +434,7 @@ should not be equal to <I>count</I>.</P>
to <I>snd_pcm_record_status</I>.</P>
<DT><B>time</B><DD><P>Lag since the next sample read was recorded. This value should be used for time
synchronization. Returned value is in the same format as returned by the
from standard C function <I>gettimeofday( &amp;time, NULL )</I>. This
from standard C function <I>gettimeofday( &time, NULL )</I>. This
variable contains right value only if record time mode is enabled (look to
<I>snd_pcm_record_time</I> function).</P>
<DT><B>stime</B><DD><P>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( &amp;handle, card, device, SND_PCM_OPEN_PLAYBACK )) &lt; 0 ) {
if ( (err = snd_pcm_open( &handle, card, device, SND_PCM_OPEN_PLAYBACK )) &lt; 0 ) {
fprintf( stderr, &quot;open failed: %s\n&quot;, snd_strerror( err ) );
return;
}
format.format = SND_PCM_SFMT_MU_LAW;
format.rate = 8000;
format.voices = 1;
if ( (err = snd_pcm_playback_format( handle, &amp;format )) &lt; 0 ) {
format.channels = 1;
if ( (err = snd_pcm_playback_format( handle, &format )) &lt; 0 ) {
fprintf( stderr, &quot;format setup failed: %s\n&quot;, snd_strerror( err ) );
snd_pcm_close( handle );
return;
}
fd = open( &quot;/tmp/test.au&quot; );
fd = open( &quot;/tmp/test.au&quot;, O_RDONLY );
if ( fd &lt; 0 ) {
perror( &quot;open file&quot; );
snd_pcm_close( handle );
@ -534,7 +534,7 @@ if ( !memcmp( buffer, &quot;.snd&quot;, 4 ) ) {
if ( idx &gt; 128 ) idx = 128;
if ( idx &gt; count ) idx = count;
}
size = snd_pcm_write( handle, &amp;buffer[ idx ], count - idx );
size = snd_pcm_write( handle, &buffer[ idx ], count - idx );
printf( &quot;Bytes written %i from %i...\n&quot;, size, count - idx );
snd_pcm_close( handle );
free( buffer );

View file

@ -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:
<enum>
<item>/usr/include/sys/soundlib.h
<item>/usr/include/linux/sound.h
<item>/usr/include/linux/sounddetect.h
<item>/usr/include/sys/asoundlib.h
<item>/usr/include/linux/asound.h
<item>/usr/include/linux/asoundid.h
</enum>
<sect>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 );

View file

@ -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 );