Skip to main content

Audio-Image-Converter

Sample Image

Converts audio to and from a picture representing the frequency-time domain, remaining perceptually lossless. When converting to .webp, achieves slightly better compression ratio than an equivalent .flac (Note that this format is not intended to compete with preeexisting audio formats/codecs, and is mostly designed as a novelty, enabling users to visually see the contents of audio files. Slight albeit unnoticeable quality loss is often unavoidable due to the conversions between several data types and representations).

The image's aspect ratio approximately corresponds to the audio's duration in minutes (with each 1588x1588 square representing 1 minute of audio), and its pixel data represents the fourier transform of the audio, with X axis representing time (left/right channels interleaved), Y axis representing frequency (default nyquist at 21000Hz), hue representing phase, and amplitude being represented as a floating-point number, where lightness is the exponent and saturation the fraction. There is slight redundancy between lightness and saturation to accomodate for the more sparse regimes of the HSL colourspace's domain.

Note that this transformation is only designed to be reversible when transforming audio to visual and back. If starting from an image not converted from audio, the audio will likely have many out-of-range values, and in addition to being unpleasant to listen to, may not accurately represent the picture when converted back.

Usage

usage: audioptic [-h] [-V] [-sr [SAMPLE_RATE]] [-f [FORMAT]] input [output]

Bidirectional spectrogram-based audio-image converter

positional arguments:
  input                 Input filename or URL
  output                Output filename

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -sr, --sample_rate [SAMPLE_RATE]
                        Sample rate; defaults to 42000
  -f, --format [FORMAT]
                        Output format; defaults to opus or webp depending on input

Download files

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

Source Distribution

audioptic-1.0.3.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

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

audioptic-1.0.3-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file audioptic-1.0.3.tar.gz.

File metadata

  • Download URL: audioptic-1.0.3.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for audioptic-1.0.3.tar.gz
Algorithm Hash digest
SHA256 9db7bea7768bc1c9fd5d8fce98428f5536b2b60938c97c9d182ded5a1a7a9fa3
MD5 07db75c09892ca16028a8f235be06891
BLAKE2b-256 9b447b90032455527da30e4aedcae4638dcb64714c7fc0c796b93231977b8d31

See more details on using hashes here.

File details

Details for the file audioptic-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: audioptic-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for audioptic-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 788fd51b8af755e8fafbb14525f3bb17a689f3d8e403901574dcdd334742db03
MD5 fa04d7c350cb9e9dc40fa1e98cef29b2
BLAKE2b-256 cd5ef9cc3cc4d0b440e59940e99d9343125d80f1b7d67e0da743886be65e6ed4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page