2017-08-25 59 views
1

通過ALSA os實用程序文檔和配置,無法弄清楚如何在Linux上將不同進程的流分離到耳機的{左,右}通道,API非常龐大。如何將不同流程的音頻流分離到不同的耳機通道?

我該如何解決這個問題,我應該使用哪些API?

+0

libalsa(開發人員) - https://www.alsa-project.org/main/index.php/Documentation –

回答

0

要創建各個通道的虛擬設備,嘗試添加類似下面你~/.asoundrc/etc/asound.conf

pcm_slave.hp { 
    pcm "hw:0"  # or "hw:1", or whatever it is 
    channels 2 
    rate 48000 
} 
pcm.ch1 { 
    type dmix 
    ipc_key 20170825 
    slave hp 
    bindings [ 0 ] 
} 
pcm.ch2 { 
    type dmix 
    ipc_key 20170825 
    slave hp 
    bindings [ 1 ] 
} 

然後在應用程序中使用的設備名稱plug:ch1plug:ch2