2016-09-30 17 views
0

私は非常に新しくしましたNAudioライブラリーと同様にオーディオタイプのファイルを開発するミキサーの各チャンネルからオーディオ入力を取得するにはどうすればよいですか? ASIOをサポート)、このミキサーは8チャンネルのオーディオ入力をサポートします。 ミキサーからオーディオ入力チャンネルを取得するNAudio C#

アプリケーションのアイデアは、この

  • チャンネル1ユーザーがボタンを押して、それがその特定のチャネル上の話者の音声をキャプチャするために、チャネル1つの入力を取得します

  • ときに、ユーザーのようなものですチャンネル2を押すと、チャンネル2(別のチャンネルとして)の音声が得られます。

だから私はちょうど(私が開発し、C#を使用しています)私はシナリオのこの種のいずれかのソースコードの例やベストプラクティスを使用して、そこにあるべきライブラリクラス迷っ

答えて

0

ありがとうございました。このコードを使用してみてください:

using System; 
using System.Windows.Forms; 
using NAudio.Wave; 

namespace NaudioAsioTest 
{ 
    public partial class Form1 : Form 
    { 
     public Form1() 
     { 
      InitializeComponent(); 
      InitialiseAsioControls(); 
     } 

    private void InitialiseAsioControls() 
    { 
     // Just fill the comboBox AsioDriver with available driver names 
     var asioDriverNames = AsioOut.GetDriverNames(); 
     foreach (string driverName in asioDriverNames) 
     { 
      comboBoxAsioDriver.Items.Add(driverName); 
     } 
     //comboBoxAsioDriver.SelectedIndex = 0; 
    } 
    public string SelectedDeviceName { get { return (string)comboBoxAsioDriver.SelectedItem; } } 

    private void OnButtonControlPanelClick(object sender, EventArgs args) 
    { 
     try 
     { 
      using (var asio = new AsioOut(SelectedDeviceName)) 
      { 
       asio.ShowControlPanel(); 
      } 
     } 
     catch (Exception e) 
     { 
      MessageBox.Show(e.Message); 
     } 
    } 

    private void comboBoxAsioDriver_SelectedIndexChanged(object sender, EventArgs e) 
    { 
     try 
     { 
      using (var asio = new AsioOut(SelectedDeviceName)) 
      { 
       //asio.ShowControlPanel(); 
       int nrOfChannelOUTDevices = asio.DriverOutputChannelCount; 
       int nrOfChannelINDevices = asio.DriverInputChannelCount; 
       listBoxInputs.Items.Clear(); 
       listBoxOutputs.Items.Clear(); 
       for (int i = 0; i < nrOfChannelOUTDevices; i++) 
       { 
        string name = asio.AsioInputChannelName(i); 
        listBoxInputs.Items.Add(name); 
       } 

       for (int i = 0; i < nrOfChannelINDevices; i++) 
       { 
        string name = asio.AsioOutputChannelName(i); 
        listBoxOutputs.Items.Add(name); 
       } 
      } 
     } 
     catch (Exception ex) 
     { 
      MessageBox.Show(ex.Message); 
     } 
    } 


} 

}

結果は以下である:

enter image description here

関連する問題