Looking for help displaying a time code embedded within an audio stream

I have developed some software in c++ which runs on Ubuntu that will remove dead time in a record voice stream and insert time tags into the wav file so that the recording time can be extracted from the recording. I built this system to record the CTAF at an airport. Lots of dead time in these types of recordings. I am looking for someone who knows how to make a plugin for Audacity so that the recording time would appear as the wave file is played back. Right now it is a bit cumbersome to play back a specific clip knowing the time it was recorded. I’ve done some searching and don’t find any software which will deal with time codes embedded within the audio channel. I’ve included a brief slice from the tower at the airport here. I would obviously help in any way I can. I know signal processing, but not plugins or GUI additions to Audacity.

You’ve never done that at LAX.

Is that what the “Boop” is?

I wondered if someone could embed SMPTE Time Code as an ultrasonic signal in a regular mono WAV file.

You can, in fact, produce a Stereo show with SMPTE on one side and Mono Production Sound on the other. Split the SMPTE off to a TC Reader. Piece 'o cake.


The beep is a 400Hz tone I put there to make it clear when dead time has been removed. The sample rate is only 12KHz so ultrasonic signaling isn’t possible. Since the format is wave, I just put the time directly into the data. It is so short you can’t hear it. If you zoom in to individual samples in Audacity you can probably find the time values following the tone.

Like this?

0, 10, -10, 10, -10, 10, -10, 10, -10, 10, -10, 7, 7, -5, 6, 6, -5, 1, 1, -5, 5, 5, -5, 4, 4, -5, 3, 3, -5, 8, 8, -5, 7, 7, -5, 0, 0, -5, 0, 0, -5, 0, 0, -5, 6, 6, -5, 1, 1, -5, 4, 4, -5, 1, 1, -5, 1, 1, -5, 0, 0, -5, 6, 6, -5, 1, 1, -5, -1, 0,

Yes, exactly like that. This audio recording is only part of the system. I operate out of one of the busiest airports in the country without a control tower. To help make the airport safer and resolve conflicts we monitor the traffic with a system (ADS-B) which almost all the aircraft have installed. The tools already developed deal with all of the aircraft tracks and each transmission. What I don’t have is a way to give a clip to someone who wants to listen to the transmissions during a specific time period or when a specific plane was in the traffic area. They can play back the wave files I can give them with any number of tools, but none of them will extract and display the time. There is no way to know if the dead time removed was 10 seconds or 10 minutes. If you ever have tried to bring up a specific time period using https://www.liveatc.net/ you’ll understand the basic problem.

I haven’t, and I know next to nothing about ADS-B or CTAF, and nothing about the “some software in C++” that you developed.

I can see that you have inserted 500ms 400Hz tone, followed by 499 samples of silence, followed by 68 samples of data.

Where is the specification for the data encoding?

The recordings (both ADS-B and the radio) are done on a computer running Ubuntu because it must run unattended and never stop. The recordings are available on Microsoft’s OneDrive and I process those at home to create a database entry describing the location of each clip. I’ve got a class which which will read the audio stream, locate the time tags and extract the time-date information. That back-end code is written in C#.
I was thinking that if someone was interested in creating the GUI part of the plug in that I would provide them with a decoder which would take in the audio samples and return the time to display.
This function would only have appeal to a wider audience if the encoder were made available which could also be done (it would be something like a compression tool).
If you think this might be interesting email to audacity@flywild.net

I could probably make a plug-in that decodes the time stamps to labels, but you would need to say how you have encoded the times.

I don’t provide free email / telephone support.

Perhaps I posted this on the wrong forum. A Ham radio or software defined radio group might be better. Someone who records sparse audio would have a use for this function. A recording of a day of audio which only contains one hour of actual talking needs this type of dead time removal. I don’t plan to make any additions to the functionality of Audacity. That would be outside my area of expertise.
I have tools I’ve developed to play back the audio with the actual local recording time shown. But if I give one of these wave files to the FAA or other interested party they must use a spreadsheet I provide which allows them translate seconds into the wave file to date time when it was recorded.

Why will you not tell us how you have encoded the time? If you have used a “secret” encoding, then of course you won’t find anything to decode it. If it’s not “secret”, then why won’t you say?

I thought that this might be an interesting project, but with your reluctance to provide essential information …?

The encoding is not secret and it is very simple. The file is saved as a wave so there is no distortion. Values go through unmodified. First a fixed sequence to locate the time code. This sequence just needed to be something which would never be found within the audio portion. I do all my processing as floats and create a wave file in 16 bit shorts.

The sequence 1.0, -1.0 (5 in a row) is output first. This is easy to locate with a simple correlation. Next I write out the sample number followed by the date time as BCD with each digit encoded in 3 samples. The first two samples are the digit using a fraction between 0 and 1 (value=digit/10.0). The third value output is -0.5 (used to verify that I am in the right place).

The digits placed in the output start with the 9 digit sample number from the original input. This is used for verification. Next the time date with 2 digits for month, day, hour, minute and second. (Note: this reminded me that I need to add the year to be complete, and probably a version number).


OK, so here’s a proof of concept. It is a Nyquist plug-in (See here for installation instructions: Nyquist Plugin Installer - Audacity Manual)
It will be slow, and has no error checking, but should be easy for you to customise if you find it useful.

LabelTimecodes.ny (2.7 KB)

When installed (don’t forget to restart Audacity), it will appear in the Analyze menu a “Label Timecodes”.

Thanks for this. It basically does what I need and it is quite simple. It runs fast enough. However the numbers printed are not correct. I assume the values (aref ar nn) are floats between -1 and 1 since it seems to find the -1,1. I don’t see the error but I’ll play with it. The digits are pushed out least significant digit first but that is easy to change. I don’t get any digits except 1 and zero. Again, thanks.

I’ve figured out the issues and fixed things. It works fine now. I haven’t seen polish notation for many, many years. Thanks

I have the plug in working well enough. I may try to add error checking but I have zero expertise with Lisp.

Nyquist is a pretty simple language, based on XLISP. As with other LISP dialects, it uses s-expressions, so rather than ‘foo(args)’ it is ‘(foo args)’.

There’s plenty of documentation available, though unfortunately it has not been maintained since muse group acquired Audacity.
Here’s some useful links:

(and my blog: https://audionyq.com/)

This topic was automatically closed after 30 days. New replies are no longer allowed.