您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

PassThroughAsyncSpdif.ino 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <Audio.h>
  2. AudioOutputSPDIF3 spdifOut;
  3. AsyncAudioInputSPDIF3 spdifIn(true, true, 100, 20); //dither = true, noiseshaping = true, anti-aliasing attenuation=100dB, minimum resampling filter length=20
  4. //
  5. AudioConnection patchCord1(spdifIn, 0, spdifOut, 0);
  6. AudioConnection patchCord2(spdifIn, 1, spdifOut, 1);
  7. void setup() {
  8. // put your setup code here, to run once:
  9. AudioMemory(12);
  10. while (!Serial);
  11. }
  12. void loop() {
  13. double bufferedTine=spdifIn.getBufferedTime();
  14. //double targetLatency = spdifIn.getTargetLantency();
  15. Serial.print("buffered time [micro seconds]: ");
  16. Serial.println(bufferedTine*1e6,2);
  17. // Serial.print(", target: ");
  18. // Serial.println(targetLatency*1e6,2);
  19. double pUsageIn=spdifIn.processorUsage();
  20. Serial.print("processor usage [%]: ");
  21. Serial.println(pUsageIn);
  22. // bool islocked=spdifIn.isLocked();
  23. // Serial.print("isLocked: ");
  24. // Serial.println(islocked);
  25. // double f=spdifIn.getInputFrequency();
  26. // Serial.print("frequency: ");
  27. // Serial.println(f);
  28. // Serial.print("Memory max: ");
  29. // Serial.println(AudioMemoryUsageMax());
  30. delay(500);
  31. }