Skip to main content

Add CART CHUNK to wave files.

Project description

Python CART CHUNK

Installation

Clone this repo and install using pip:

$ git clone https://github.com/maxtimbo/python_cart_chunk
$ cd python_cart_chunk
$ pip install .

Usage

You can use the CartChunk class to read CART CHUNK headers as well as riff and fmt data of a wave file:

from cart_chunk import CartChunk
from pathlib import Path

src = Path('/path/to/wave/file.wav')

wav = CartChunk(src)

if wav.is_scott:
    for key, value in wav.scott_data.items():
        print(f'{key:<20}: {value}')
else:
    print('Does not contain CART CHUNK')

for key, value in wav.riff_data.items():
    print(f'{key:<20}: {value}')

for key, value in wav.fmt_data.items():
    print(f'{key:<20}: {value}')

for key, value in wav.data_meta.items():
    print(f'{key:<20}: {value}')

Use the CartChunk class to write a new copy with the CART CHUNK. The following keyword args are available:

  • artist str
  • title str
  • trivia str
  • year int
  • category str
  • cart str
  • intro float
  • sec float
  • eom float
  • start_timestamp tuple
  • end_timestamp tuple
  • hrcanplay list[list[int]]
from cart_chunk import NewCart

new_file = Path('/path/to/new/file.wav')

new_cart = NewCart(new_file, artist='artist', title='title')

wav.write_copy(new_cart)

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

python_cart_chunk-0.0.1b9.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

python_cart_chunk-0.0.1b9-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file python_cart_chunk-0.0.1b9.tar.gz.

File metadata

  • Download URL: python_cart_chunk-0.0.1b9.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for python_cart_chunk-0.0.1b9.tar.gz
Algorithm Hash digest
SHA256 4a893a0a7614c70bea5d4e36a8f28c18f6c9ec0d74284cf1af72f5ffd3792994
MD5 a042636343d7ff7c949f358d43596378
BLAKE2b-256 9e14df0bf3e909c14a18b9ce025f73aaa73eb127972b97351f27248318fe98e5

See more details on using hashes here.

File details

Details for the file python_cart_chunk-0.0.1b9-py3-none-any.whl.

File metadata

File hashes

Hashes for python_cart_chunk-0.0.1b9-py3-none-any.whl
Algorithm Hash digest
SHA256 12a6d3dd7c5520493d19b35b78f4d4f8ca453cd673a6c16d12319d91afae17ab
MD5 9eeb073ab5aba3572535f13ac3ee24c0
BLAKE2b-256 b538eaf29c0e2477e8bbe5ec8122bf7e8bbfdf90a935bced2633cdb64defc3b6

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