#!/usr/bin/env node 'use strict'; /** * ltc-reader — decode SMPTE LTC from an audio feed and push it to ProdDash. * * ProPresenter's APIs expose no timecode (see modules/propresenter-timers), * so this tool reads LTC where it actually lives: the audio signal. Pipe * mono PCM (signed 16-bit little-endian) into stdin from any capture * front-end; the decoded state is POSTed to the Timers module's /ltc * ingest route — ~4×/s while running, 1×/s as a keepalive otherwise, and * immediately on every state change. * * macOS (ffmpeg; list input devices with * `ffmpeg -f avfoundation -list_devices true -i ""`): * ffmpeg -loglevel error -f avfoundation -i ":0" -ac 1 -ar 48000 \ * -f s16le - | node tools/ltc-reader.js --url http://127.0.0.1:24500 * sox (default input device): * sox -q -d -t raw -b 16 -e signed -c 1 -r 48000 - | node tools/ltc-reader.js * Windows (ffmpeg/dshow): * ffmpeg -loglevel error -f dshow -i audio="" -ac 1 \ * -ar 48000 -f s16le - | node tools/ltc-reader.js * * Flags: * --url ProdDash base URL (default http://127.0.0.1:24500) * --module target module id (default propresenter-timers) * --token matches the module's "LTC reader token" admin setting * --sr stdin sample rate (default 48000) * --source