Skip to main content

ltc-reader

Python ltc reader.

[[TOC]]

A generic LTC decoder

LTC stands for Linear Timecode and is a signal used in media production to time synchronize multiple sources of audio and video involved in same production.

LTC is an analog audio signal and because of it can be easily transmitted among stations and added as an audio channel with other audio and video.

Installation

pip install ltc-reader

Usage

The test code in LTCMapTest shows how to use this:

        with wave.open("tests/Audio_2.wav") as wav_file:
            metadata = wav_file.getparams()
            if metadata.nchannels != 1:
                raise ValueError("1-channel data required")  # noqa: EM101
            # frames = wav_file.readframes(metadata.nframes)
            data: bytes = wav_file.readframes(metadata.nframes)
            chan: Channel = ByteChannel(data, metadata.framerate, metadata.sampwidth, "little", None)

            map: LTCMap = LTCMap.fromChannel(chan)
            print(map)

Most lines are just fetching your audio from a file and extracting the data, sample rate, data width etc. You can change this with other code to read your favourite encoding (eg mp3 , aiff, flac, etc). The decoded data is then put into the Channel object and that is used to create the LTCMap. The Channel ensures the audio is 1-channel with float samples, and ensures there is a get method to get the Nth sample in the audio.

The example uses an ByteChannel, which assumes your data consists of a list of samples and each sample is a fixed number of bytes in little or big endian form. If your data has a different behaviour, you can implement your own Channel to map map/adapt to the required form. Your data doesn't even have to be in memory for that.

The LTCMap processes all the Channel samples and finds all the LTCs contained. This map can be accessed through the getMap method. This map contains all sample positions (int) and the extracted LTCFrame data. The sample position is the first sample of the LTC code in the channel.

[!warning] The library currently supports only 48kHz audio. But you can implement a channel doing a simplistic conversion from any other rate.

[!note] This contains hard copy of tudelft.utilities 1.1.6 from https://gitlab.ewi.tudelft.nl/interactive-intelligence/utilities/utilitiespy

Contributing

If you like to contribute have a look at the Contributing page.

License

Distributed under the terms of the GPL license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ltc_reader-1.0.4.tar.gz (37.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ltc_reader-1.0.4-py3-none-any.whl (53.5 kB view details)

Uploaded Python 3

File details

Details for the file ltc_reader-1.0.4.tar.gz.

File metadata

  • Download URL: ltc_reader-1.0.4.tar.gz
  • Upload date:
  • Size: 37.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ltc_reader-1.0.4.tar.gz
Algorithm Hash digest
SHA256 8fcb0c6ec42d71f467d7bd011c15496009791d1d6999cacb1a19d3f1200a9dbc
MD5 c89ee849262f9c6ce04c944f5d4ff26f
BLAKE2b-256 3f7936ae87ae3734f7d1130bc124dfd858529eed1d43cd60b1a4f794b5f960af

See more details on using hashes here.

File details

Details for the file ltc_reader-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: ltc_reader-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 53.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ltc_reader-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d53b5b628c43f1e509a4653ed9b2373937eaddd546439f01d96fb80a935eac50
MD5 9bd6573e86d6a7df0667a800f0479166
BLAKE2b-256 be44f21b9157f454cd3d2722e0f527f8a332d2988ab7eb8c3e4b88beafed0d7d

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.5

2 files

This release

1.0.4 This release

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page