Skip to main content

Printing and viewing spectrograms of audio files in command line

Project description

inspec

View spectrograms of audio data files in the terminal as ascii characters. Provides printing to stdout, a terminal gui built on curses, and importable functions.

install

pip install inspec

cli

Invocation of inspec uses the entrypoint python -m inspec.cli.

inspec open

Usage: inspec open [OPTIONS] [FILENAMES]...

  Open interactive gui for viewing audio files in command line

Options:
  -r, --rows INTEGER  Number of rows in layout
  -c, --cols INTEGER  Number of columns in layout
  -t, --time FLOAT    Jump to time in file
  --cmap TEXT         Choose colormap (see list-cmaps for options)
  --help              Show this message and exit.

inspec open demo

inspec show

Usage: inspec show [OPTIONS] FILENAME

  Print visual representation of audio file in command line

Options:
  --cmap TEXT           Choose colormap (see list-cmaps for options)
  -d, --duration FLOAT
  -t, --time FLOAT
  --amp                 Show amplitude of signal instead of spectrogram
  --help                Show this message and exit.

inspec show demo

importing in python

The code can be imported so renders can be done dynamically in other programs. This is the current gist but would be nice to make a simpler way to do this.

from inspec.plugins.audio.spectrogram_view import BaseAsciiSpectrogramPlugin

# Printing to stdout
plugin = BaseAsciiSpectrogramPlugin()
plugin.set_cmap("plasma")
plugin.read_file(FILENAME)
plugin.render()

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

inspec-0.2.tar.gz (24.6 kB view hashes)

Uploaded source

Built Distribution

inspec-0.2-py3-none-any.whl (24.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page