You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 line
1.1KB

  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. }