2016/3/8

tinyalsa : tinyplay

root@sabreauto_6q:/ # tinyplay                                                 
Usage: tinyplay file.wav [-D card] [-d device] [-p period_size] [-n n_periods] 

看一下source:
pcm.c : pcm_open( )
    snprintf(fn, sizeof(fn), "/dev/snd/pcmC%uD%u%c", card, device,
             flags & PCM_IN ? 'c' : 'p');

    pcm->flags = flags;
    pcm->fd = open(fn, O_RDWR);
看一下系統 /dev/snd/..
1|root@sabreauto_6q:/ # ls /dev/snd/
controlC0
controlC1
pcmC0D0c
pcmC0D0p
pcmC1D0c
timer
所以play 就是...
# tinyplay 1ch48k.wav -D 0 -d 0

沒有留言:

張貼留言