Skip to main content

Python ltc reader.

Project description

LTC Reader

A generic basic 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.

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.

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

Project details


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.1.tar.gz (36.2 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.1-py3-none-any.whl (52.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ltc_reader-1.0.1.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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.1.tar.gz
Algorithm Hash digest
SHA256 b7849c6a1af5cd063e80da05862a3a8d3283e0de9bff1a40805ae3de5e0d143a
MD5 27934efc944b76a632b6e4b64b5d621b
BLAKE2b-256 bf956ded354c2fdf73a9f124e4645f812afff0d875df87d895c8523f3039ffa6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ltc_reader-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 52.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fcdbae6305b273288b7ce1d864ad47dfdbd6e3dfe880b81b3911f863b1092d3b
MD5 7441110e6921f98be6663b2af59e59d9
BLAKE2b-256 1bc275c9e572cdb2db4682729fc192a5c0ffa8b11e1f09418246ac6c686dbcb0

See more details on using hashes here.

Supported by

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