Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

30 linhas
1.0KB

  1. #include <Audio.h>
  2. #include <Wire.h>
  3. #include <SPI.h>
  4. #include <SD.h>
  5. #include <SerialFlash.h>
  6. AudioInputUSB usb1; //xy=200,69 (must set Tools > USB Type to Audio)
  7. AudioOutputI2S i2s1; //xy=365,94
  8. AudioConnection patchCord1(usb1, 0, i2s1, 0);
  9. AudioConnection patchCord2(usb1, 1, i2s1, 1);
  10. AudioControlSGTL5000 sgtl5000_1; //xy=302,184
  11. void setup() {
  12. AudioMemory(12);
  13. sgtl5000_1.enable();
  14. sgtl5000_1.volume(0.6);
  15. }
  16. void loop() {
  17. // TODO: make PC's volume setting control the SGTL5000 volume...
  18. }
  19. // A known problem occurs on Macintosh computers, where the Mac's driver
  20. // does not seem to be able to adapt and transmit horribly distorted
  21. // audio to Teensy after a matter of minutes. An imperfect workaround
  22. // can be enabled by editing usb_audio.cpp. Find and uncomment
  23. // "#define MACOSX_ADAPTIVE_LIMIT". More detailed info is available here:
  24. // https://forum.pjrc.com/threads/34855-Distorted-audio-when-using-USB-input-on-Teensy-3-1?p=110392&viewfull=1#post110392