Skip to content

A plugin for Nicotine+ that generates an audio spectrogram image using SoX after an audio file has finished downloading.

Notifications You must be signed in to change notification settings

ewauq/sox_spectrogram_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SoX Spectrogram Generator Plugin for Nicotine+

A plugin for Nicotine+ that generates spectrograms using SoX after a file has finished downloading.

Spectrogram

📖 How to use

  • Create a folder named sox_spectrogram_generator in C:\Users\<user>\AppData\Roaming\nicotine\plugins\ and copy the contents of the src folder into this new folder.

  • You need to have the SoX binary on your system. You can add it to your system PATH or set a custom path to the SoX binary in the plugin settings.

  • Windows users only: since the MAD decoder library is not bundled with SoX for patent reasons, you will need to add it manually. You can either compile it yourself from the source, or copy a compiled version of libmad.dll in the same directory as SoX binary. You can find the file on this repository which is provided by videohelp.com.

⚙️ Settings

Path to SoX binary

The SoX path to the executable.

Leave the value empty if SoX is already in your system PATH. If not, you can specify the full path including the executable file.

  • Default value : empty (taken from the PATH)

Audio channel

Audio channel to generate the spectrogram from.

If you want to generate an audio spectrogram from just one channel, change it to Left or Right.

  • Default value: Left and right

Spectrogram width and height

Width and height in pixels of an audio channel spectrogram.

This refers to the size of the spectrogram area, not the overall image dimensions. For example, if you select Left and Right channels, the final image height will be 2 × height plus space for default text, borders, and margins.

  • Width range: 64 to 200000
  • Width default value: 800
  • Height range: 64 to 512
  • Height default value: 257

Note: to prevent a slow generation, the height must always be a power of two plus one. The value will be automatically adjusted to fit this requirement (e.g., 512 will be modified to 513).

Title

Title to display at the top of the generated image.

It can be the filename without the extension, the filename with the extension or the full path including the filename and the extension. Be careful not to include sensitive information when using the full path option.

  • Default value: no title

Comment

Comment to display at the bottom left of the image.

Some text to replace "Created by SoX". Be aware that if the comment is wider than the final image, it won't be displayed. If you want no comment at all, you can add a blank space.

  • Default value: Created by SoX

Starting position

Starting analysis position in seconds.

If you want to start the audio analysis further from the beginning, you can specify the position in seconds from where it has to start. If the given value is higher than the audio length, it will produce a useless image.

  • Default value: 0

Duration

Duration of the analysis in seconds.

If you just want an audio spectrogram of a 30 seconds audio clip, change the value to 30. The analysis will start at the starting position previously set (see above).

  • Default value: 0

Window function

The window parameter to use to generate the audio spectrogram.

Available options:

  • Hann: "for good all-round frequency-resolution and dynamic-range properties"

  • Hamming: "for better frequency resolution but lower dynamic-range"

  • Bartlett

  • Rectangular

  • Kaiser "for higher dynamic-range but poorer frequency-resolution"

  • Dolph

  • Default value: Hann

Monochrome

Generate a monochromatic spectrogram

Will generate a black and white audio spectrogram image.

  • Default value: off

Raw image

Hide axes and labels.

Will generate a raw spectrogram image without any text, borders, margins, just the spectrogram areas.

  • Default value: off

High color mode

Use the high-intensity color mode.

Will saturate colors which is less visually pleasing than the default colour palette, but it may make it easier to differentiate different levels.

  • Default value: off

Light mode

Use a white background instead of the black one.

  • Default value: off

Brightness

Allows brightness adjustments of the audio spectrogram, if needed.

  • Range: 20 to 180
  • Default value: 120

Contrast

Allows contrast adjustments of the audio spectrogram, if needed.

  • Range: -100 to 100
  • Default value: 0

Number of colors

Allows to change the number of colors to render the audio spectrogram. Low values give a poster-like effect and produce smaller PNG files.

  • Range: 1 to 249
  • Default value: 249

(some descriptions were taken from the SoX manual)

About

A plugin for Nicotine+ that generates an audio spectrogram image using SoX after an audio file has finished downloading.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages