mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
New docs..
This commit is contained in:
parent
2ae16fb30d
commit
82fc81e31e
3 changed files with 11 additions and 11 deletions
|
|
@ -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( &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( &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,14 +503,14 @@ 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.channels = 1;
|
||||
if ( (err = snd_pcm_playback_format( handle, &format )) < 0 ) {
|
||||
if ( (err = snd_pcm_playback_format( handle, &format )) < 0 ) {
|
||||
fprintf( stderr, "format setup failed: %s\n", snd_strerror( err ) );
|
||||
snd_pcm_close( handle );
|
||||
return;
|
||||
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue