0
設置麥克風輸入音量要raspberrry applicance我需要安裝麥克風的輸入音量programaticaly的Debian - 的pulseaudio - 在C++
在C++,我可以讀取的實際值(改變,如果我在PA改變它混音器),但我設置它,似乎並沒有工作...在我推出我的代碼後,我檢查了面板調音臺,音量沒有變化
下面,其渠道和音量
SOURCE : [0] 'alsa_output.usb-0d8c_C-Media_USB_Headphone_Set-00-Set.analog-stereo.monitor' 'Monitor of Audio Adapter Analog Stereo'
(0)= 65536
(1)= 65536
SOURCE : [1] 'alsa_input.usb-0d8c_C-Media_USB_Headphone_Set-00-Set.analog-mono' 'Audio Adapter Analog Mono'
(0)= 26281
SOURCE : [2] 'alsa_output.0.analog-stereo.monitor' 'Monitor of bcm2835 ALSA Analog Stereo'
(0)= 65536
(1)= 65536
所以我嘗試更改源索引號的數量#1
void setVolume(int index,int volume)
{
pa_operation* o;
currentVolume.values[0]=volume;
if (!(o = pa_context_set_source_output_volume(context, index, ¤tVolume, NULL, NULL)))
{
printf("pa_context_set_source_output_volume() failed");
return;
}
printf("new volume: %d\n",currentVolume.values[0]);
pa_operation_unref(o);
}
請問能有人幫忙嗎?
感謝