私はArduinoの上でこのコードを実行しています。 Arduinoを使って、オーディオをPCのスピーカーに渡す方法はありますか?Arduino経由でPCスピーカーから音声を再生するには、このコードに何を追加しますか?
//This imports the audio class
#include <PCM.h>
//This is the sound being played
const unsigned char sound1[] PROGMEM = {129, 127, 126, 127, 128, 128, 128, 12};
//constant variables
const int knockSensor = A0;
const int threshold1 = 10;
//This create a variable
int sensorReading = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
sensorReading = analogRead(knockSensor);
if (sensorReading >= threshold1) {
Serial.println(threshold1);
startPlayback(sound1, sizeof(sound1));
}
delay(200);
}
がどのようにArduinoのは物理的に(直接的または間接的に)PCのスピーカーに接続されているの/ dev /オーディオにデータを足すことで、本当に簡単だろうというのLinuxを使っている場合は?ボードは、シリアルポートを介して接続されている7. –