サウンドを録音するための小さなプログラムを作成しました (JavaSound と TargetDataLine を使用してサウンド カードに到達します)。JSYN の「DualOscilloscope.java」クラスを使って音のビジュアルをテストしました。問題は、彼らのクラスが「シンセサイザー」で行を開くため、サウンドカードで2行をタップすると、例外がトリガーされます(サウンドカードで2行を開くことができないため)。インスタンス化した TargetDataLine を使用して JSYN のシンセサイザを初期化することは可能ですか?
ソース コード クラス DualOscilloscope (著者 Phil Burk )
protected void startAudio(int itemIndex) {
// Both stereo.
int numInputChannels = deviceMaxInputs.get(itemIndex);
if (numInputChannels > 2)
numInputChannels = 2;
int inputDeviceIndex = deviceIds.get(itemIndex);
synth.start(16000, inputDeviceIndex, numInputChannels, AudioDeviceManager.USE_DEFAULT_DEVICE, 0);
channel1.output.connect(pass1.input);
// Only connect second channel if more than one input channel.
if (numInputChannels > 1) {
channel2.output.connect(pass2.input);
}
// We only need to start the LineOut. It will pull data from the
// channels.
scope.start();