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

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_cart_chunk-0.0.1b7.tar.gz
  • Upload date:
  • Size: 7.4 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.1b7.tar.gz
Algorithm Hash digest
SHA256 ded1e274042f1833cfadeb141644bc14a904bba10297dcb0091ef49b9318e0d7
MD5 f4811b85de2c8eb7a5e9654b0c929363
BLAKE2b-256 c71bb981a6926fb3c3a464eaf6ad4d2482efd301331a1a309ef819bec0359758

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_cart_chunk-0.0.1b7-py3-none-any.whl
Algorithm Hash digest
SHA256 cabf8dc9a78fe34fa79027baaf23e5ed44042207f3ace08185f5a6c7edcda798
MD5 ff87c8d39c663bdc3fde2a12b88ca2ea
BLAKE2b-256 ac7caa63ac375641310da06d7781e2c429bf3876285b063e618e5cd2cc9e38c1

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