Import Sony Track Marks

I record with a Sony digital voice recorder, the ICD-UX570. It has a nice “T-mark” button to create a track mark at the current recording position. What this actually does is write a timestamp into a file that’s named the same as your recording but with a “.tmk” extension. (It’s technically a binary format, but it’s just a few magic bytes to identify the file, then a simple “[minutes:seconds]” on each line.)

I couldn’t find an existing plug-in to import these as Audacity labels, so I thought I’d give it a try. I haven’t used Audacity for very long, nor have I written anything real in Lisp before, so the code might be gnarly, but it seems to work in my testing. It’s based on the standard file button tutorial but with the Sony magic added.

Usage note: the timestamps are relative to the start of the file, so you’ll want to select the whole file before running the plugin.

Looks good.

I think any open-source license is fine. GPL v2, v3, or v2+ are all fully compatible with Audacity’s license. I usually go with GPL v2+ (version 2 or later). I’m not a lawyer, but I doubt there is any problem regarding Sony’s license / patents as you’re only using data from your recorded files.

I can’t test the plug-in as I don’t have a Sony voice recorder, but one thing that I’d suggest is to put all of the plug-in “header” lines at the top, like this:

;nyquist plug-in
;version 4
;name "Import Sony Track Marks"
;release 0.0.1
;author "Tom Kirchner"
;type tool analyze
;preview disabled
;debugbutton disabled

;control filepaths ...

and then use double “;” for the comment block:

;; Tested with Audacity 3.4.2.
;; Based on
;; This plugin imports track markers from a a .tmk file, as generated by Sony
;; voice recorders when hitting their "T-mark" button.
;; ...

This change makes no difference to the functionality - it’s just a matter of convention.

1 Like

Oh yes, one other thing I’d suggest is to retain the debug button at least until you have a version 1.0.0 release.

1 Like

Thanks for taking a look!

I wasn’t concerned about Sony (there’s nothing proprietary here) but rather the fact that I used code from the tutorial directly, and the tutorial page doesn’t list a license for that code, so I’m not sure how I’m allowed to license this. If the examples are GPL2, that’s fine, but sometimes documentation uses licenses that aren’t typically used for code, and I’m not sure about compatibility.

Oh, right! I should have included a sample file. I’ll attach a simple one here with four track marks. (It’s renamed to .txt because .tmk isn’t allowed; just remove the .txt.)
240117_2144.tmk.txt (63 Bytes)

Thanks for the suggestions! I’ll add those and upload a new version, maybe after I’m clear about the licensing.

Not a problem. I wrote that code for the Audacity wiki and it was intended to provide Audacity users with a starting point for writing their own code. I’m pleased to see that it is still useful. I prefer that my documentation is used for open-source because I’m a supporter of open-source, but it is not required.
The Audacity wiki was licensed under Attribution 3.0, so if you republish the documentation, it needs to be attributed (see the link for details).

Thanks for the sample .tmk file. The plug-in works as expected here on Linux with Audacity 3.5.0 alpha.

Another suggestion that I’d make is in file widget, provide an “All files” option. (That would have saved me having to remove the .txt extension).

1 Like

Thanks! I’ll license this as GPL2, per your comment. I link to the original in the header.

Thanks for testing!

I’ve implemented all your suggestions and posted v0.0.2 above.

Hi, appreciate any help. I have no idea what the discussion above means but it sounds like you are familiar with Sony tmk files. For some reason my Sony digital recorder recorded some audio files as a tmk format. I can’t access the file and I need the data!!! Trying many 3rd party apps that don’t recognize TMK. I am fairly desperate. Can you help?? Thank you?

The files ending ".tmk"just contain timing information, not audio.
There should be a much bigger file with a similar name to the one ending “.tmk” which contains the audio in a proprietary Sony audio format.
Sony software can convert it into WAV format which is universally supported …

@Greta Like Trebor said, you should see the audio file right next to the tmk file. The tmk file should be small in size, nowhere near big enough to hold the audio. If you open it in a text editor, you should see a few characters of gibberish at the start, and then some timestamps. It’s not the actual audio.

contains the audio in a proprietary Sony audio format.

Not necessarily - it depends on the recorder. Mine can only record in WAV and MP3, no Sony-proprietary formats.