Skip to main content

Add your description here

Project description

Bytes2wavbytes

What is this?

  • converts bytes to wav format
  • as part of audio transcription pipeline

Why is repo?

  • audio loading library, such as librosa, soundfile, and audioread, does not support loading audio from video format, such as mp4, webm.
  • high level audio transcription server (vLLM) does not support video (yet)
  • this repo bridges the gap by converting any media format to WAV ( a lossless format)
  • this repo is intended to be a component of a larger audio transcription pipeline, such as librosa and vLLM

Convert bytes to wav format bytes

from bytes2wavbytes import bytes2wavbytes

input_file = "example_input.mp4"
output_file = "example_output.wav"
with open(input_file, "rb") as fin:
    input_bytes = fin.read()

    wav_bytes = bytes2wavbytes(input_bytes)
    with open(output_file, "wb") as fout:
        fout.write(wav_bytes)

Compatibility with librosa

import io
import librosa
from bytes2wavbytes import bytes2wavbytes

input_file = "example_input.mp4"
with open(input_path, "rb") as fin:
    input_bytes = fin.read()

wav_bytes = bytes2wavbytes(input_bytes)
bytes_ = io.BytesIO(wav_bytes)
y, sr = librosa.load(bytes_)

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

bytes2wavbytes-0.1.1.tar.gz (161.6 kB view details)

Uploaded Source

Built Distribution

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

bytes2wavbytes-0.1.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file bytes2wavbytes-0.1.1.tar.gz.

File metadata

  • Download URL: bytes2wavbytes-0.1.1.tar.gz
  • Upload date:
  • Size: 161.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.6

File hashes

Hashes for bytes2wavbytes-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dd2613b63ce2f7984e76d487442cbf3efc8d9419e0d363a1b2b2c8b793811fca
MD5 020c63e0a390d47a7505f681106d0567
BLAKE2b-256 59f6368e737b686d2c76c4536f8396402f8cd91ee3b8c8c43335e65ed4ccb1a5

See more details on using hashes here.

File details

Details for the file bytes2wavbytes-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for bytes2wavbytes-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9249b360a3e1dd5c1420cf1c27947c8934152b130e13927bffdb26cdcfe37378
MD5 97a19264ab89c8f170e86afbbd9c2a81
BLAKE2b-256 14cb6e5bb64980c4352824c13d9a8c6a68100d4b24f862951f3012f7fd64b83f

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