[请教]蓝牙A2DP耳机与笔记型计算机内建喇叭声音切换?

Totem,mplayer,sopcast,realplayer,bmp
回复
hill33love
帖子: 2
注册时间: 2008-11-13 17:04

[请教]蓝牙A2DP耳机与笔记型计算机内建喇叭声音切换?

#1

帖子 hill33love » 2008-11-13 17:15

最近在用蓝芽耳机A2DP听音乐
播放器是用banshee的,我有用一个按钮就是可以切换蓝芽耳机与计算机内建喇叭的功能
主要就是用执行一个script
#!/bin/bash

state=`gconftool --get /system/gstreamer/0.10/default/musicaudiosink | cut -d\ -f1`

if [ $state == "autoaudiosink" ]; then
gconftool --type string --set /system/gstreamer/0.10/default/musicaudiosink "alsasink device=bluetooth"
zenity --info --title="GStreamer" --text="Switched to Bluetooth headphones."
else
gconftool --type string --set /system/gstreamer/0.10/default/musicaudiosink "autoaudiosink"
zenity --info --title="GStreamer" --text="Switched to speaker output."
fi

echo musicaudiosink set to `gconftool --get /system/gstreamer/0.10/default/musicaudiosink`
但这个功能没有办法及时切换,要它继续播到下一首歌或是我重新按播放的功能才会切换到另一个输出
所以我研究过audio的架构:

■Audio

----------------------------------------------------------
│Application │
│ Banshee Amarok │
│ ↓ │
----------------------------------------------------------
│Desktop Environment │
│ ↓ ↓ ↓ │
│ GNOME KDE XFCE │
│ │
--------------------------DBus----------------------------
│ │
---------------------------------------------------------- GStreamer framework
│Sound Server │
│ ↓ ↓ │
│ ↓ ↓ │
│ ESD aRTs PulseAudio│
----------------------------------------------------------
│Kernel │
│ ↓ │
│ ALSA driver │
----------------------------------------------------------
│Hardware │
│ ↓ │
│ Soundcard │
----------------------------------------------------------
是否是我只控制到Gstreamer译码器这边的部份,如果要做到实时的话,是否说要控制到kernel那部份
才可以达到实时声音切换的功能,谢谢
OS: [Xubuntu] 8.04.1 kernel 2.6.24-19-generic
hill33love
帖子: 2
注册时间: 2008-11-13 17:04

Re: [请教]蓝牙A2DP耳机与笔记型计算机内建喇叭声音切换?

#2

帖子 hill33love » 2008-11-18 10:13

想请问一下大家有声音输出切换的经验吗?
谢谢
:em06
回复