Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1259907
  • 博文数量: 548
  • 博客积分: 7597
  • 博客等级: 少将
  • 技术积分: 4224
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-15 13:21
个人简介

嵌入式软件工程师&&太极拳

文章分类

全部博文(548)

文章存档

2014年(10)

2013年(76)

2012年(175)

2011年(287)

分类: LINUX

2011-03-14 21:07:28

或者使用
aplay -Dplug:dmix 出嫁.wav
3. alsa测试5.1声道
speaker-test -Dplug:surround51 -c6 -twav

speaker-test 1.0.21

Playback device is plug:surround51
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 3 to 5461
Period size range from 3 to 5461
Using max buffer size 5460
Periods = 4
was set period_size = 1365
was set buffer_size = 5460
0 - Front Left
4 - Center
1 - Front Right
3 - Rear Right
2 - Rear Left
5 - LFE
Time per period = 8.531396
0 - Front Left
4 - Center
或者使用plugin方式播放,但是仍然不能与mplayer同时播放
speaker-test -Dplug:front -c6 -twav
或者
speaker-test -Dplug:dmix -c6 -twav

打开pcm设备时用snd_pcm_open(&handle, "default", SND_PCM_STREAM_PLAYBACK, 0)就直接打开hw而不会进过plugin层

当前pcm支持的所有功能插件--来自alsa-lib-1.0.21a/configure|21776|
PCM_PLUGIN_LIST="copy linear route mulaw alaw adpcm rate plug multi shm file null empty share meter hooks lfloat ladspa dmix dshare dsnoop asym iec958 softvol extplug ioplug mmap_emul"
aplay能够smplayer同时播放,但是不能与终端上的mplayer一起播放,原因是这样的,mplayer默认使用oss方式操作声卡,因为oss是独占声卡,所以当然就出现了,当aplay打开后,打开mplayer,因为声卡被aplay占用,mplayer将等待直到aplay释放声卡为止,而当mplayer先打开播放,那么因为oss使得声卡被mplayer独占,所以aplay老是提示:Device or resource busy,解决方法就是,让mplayer使用alsa驱动播放数据:
mplayer -ao alsa 出嫁.mp3
aplay 出嫁.wav
aplay -v 出嫁.wav 可以打印出stream参数信息
这样mplayer和aplay就可以同时使用了[luther.gliethttp]

http://hi.baidu.com/zhupan19851230/blog/item/9deabedd98848555ccbf1a9d.html

阅读(1495) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~