Linux下实现多音频
来源:互联网
作者:west263.com
时间:2008-04-16
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!
pcm.!dmix, pcm.!dsnoop, pcm.!default是分别重新定义dmix,dsnoop插件,连同default设备,目的是为了使skype更好的工作。
下面的pcm.dsp0, ctl.mixer0是为了使用aoss的程式。
先讲讲怎么样使一些常见的程式都能够使用alsa的dmix混音
mplayer: 在/etc/mplayer.conf中修改ao
ao="alsa:device=dmix"
xmms: options->preferences->output plugin选择alsa output plugin,并配置,audio device填入dmix
gaim: preferences->interface->sounds->sounds method, Method选择command, sound command填入“aplay -D plug:dmix %s”
这些都是比较alsa friendly的,下面看其他的一些
realplay: 使用aoss, 写个脚本把真正的realplay包起来,将脚本mv为/usr/bin/realplay
代码:
#!/bin/sh |
注:gentoo里二进制包的软件,都放在/opt里,不是任何的系统都这么处理。所以不要照抄这一段
firefox(flash plugin): 和上面类似,脚本内容为,存为/usr/bin/firefox
代码:
#!/bin/sh |
注:这只是为了flash插件,mplayer插件上面配置完就能够使用dmix了
stardict:稍微麻烦一点,他使用esound(esd)。所以假如读者使用gentoo的话要先USE=“alsa" emerge media-sound/esound,然后rc-update add esound default
然后修改/etc/esd/esd.conf,在spawn_options最后加上-d default
代码:
[esd] |
注:stardict在刚开机的时候不行,关掉stardict再开己能够了,只需要一次。
最后来看看skype
首先我们来通过KDE控制中央来配置一下arts
Sound System
General: 选择enable the sound system, run with the highest possible priority(realtime priority)
Sound buffer调节到92 miliseconds(8 fragments with 2048 bytes)
Hardware: 音频设备:Advanced Linux Sound Architecture
选择full duplex , using custom sampling rate: 48000 , Quality: 16 bits
好了,再看skype
gentoo中skype装在/opt/skype下
笔者写个了个脚本叫skype放在了/usr/bin/下
代码:
#!/bin/sh |
这样基本上就大功告成了。只是以后使用skype的时候要确保先启动artsd
先这样吧,假如有问题以后再补充
最后推荐个好网站
http://alsa.opensrc.org
更有一些连接
http://gentoo-wiki.com/HOWTO_ALSA_sound_mixer_aka_dmix
http://www.alsa-project.org/alsa-do...cm_plugins.html
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!



