/* Linear Timecode for Audio Library for Teensy 3.x / 4.x
USB-Audio Example
Copyright (c) 2019, Frank Bösing, f.boesing (at) gmx.de
Please support PJRC's efforts to develop open source software by purchasing
Teensy or other PJRC products.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice, development funding notice, and this permission
notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
https://forum.pjrc.com/threads/41584-Audio-Library-for-Linear-Timecode-(LTC)
LTC example audio at: https://www.youtube.com/watch?v=uzje8fDyrgg
or : http://elteesee.pehrhovey.net/
Howto: Set USB-Type to USB-Audio, on PC: Play LTC Audio and set audio-output to use Teensy as audio-device.
*/
#include <Audio.h>
[COLOR=#ff8c00]#include <analyze_ltc.h>[/COLOR]
// GUItool: begin automatically generated code
AudioInputUSB usb1; //xy=386,450
[COLOR=#ffa07a]AudioAnalyzeLTC ltc1;[/COLOR] //xy=556,396
AudioOutputI2S i2s1; //xy=556,469
AudioConnection patchCord1(usb1, 0, i2s1, 0);
AudioConnection patchCord2(usb1, 0, ltc1, 0);
AudioConnection patchCord3(usb1, 1, i2s1, 1);
// GUItool: end automatically generated code
[COLOR=#ffa07a]ltcframe_t ltcframe;[/COLOR]
void setup() {
AudioMemory(12);
}
void loop() {
if ([COLOR=#ffa07a]ltc1.available()[/COLOR]) {
[COLOR=#ffa07a]ltcframe = ltc1.read();[/COLOR]
Serial.printf("%02d:%02d:%02d.%02d\n", [COLOR=#ffa07a]ltc1.hour(<cframe), ltc1.minute(<cframe), ltc1.second(<cframe), ltc1.frame(<cframe)[/COLOR]);
}
}