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

Metadata

Release files for audioptic 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for audioptic 1.0.4
File Size Uploaded
audioptic-1.0.4.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for audioptic 1.0.4
File Interpreter ABI Platform
audioptic-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 34.6 kB

Release files / audioptic-1.0.4.tar.gz

Download URL audioptic-1.0.4.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e49bc623ff113fa63d37c852ea17fa9c95f7f5dd19df1184cd27afb2d82f0e45
BLAKE2b-256 checksum
How to use checksums
5414f1bf1e96e04a842f072d57a5eb8ebd7a4fbeee35dd13e93dd2bd83ea2195
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / audioptic-1.0.4-py3-none-any.whl

Download URL audioptic-1.0.4-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7ef9d61f4f85b0073b2c8d65fdf363b02c095b01db22a121289b9eae656f760
BLAKE2b-256 checksum
How to use checksums
4cbf4d3778f597fae327c00e2045b866e37db29d41a2c22fb8d211087b9aeb22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release 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