audiowaveform(1)
π NAME π
okay so bestie, welcome to audiowaveform β the little icon that generates and renders waveforms from audio files. literally does what it says on the tin, no cap. β¨
quick housekeeping: this whole page lives in the General Commands Manual section, and i'm gonna walk you through it like we're texting at 2am. π«Ά
π SYNOPSIS π
audiowaveform [options]
that's it. that's the whole vibe. the options do all the heavy lifting, iykyk. π
π¦ DESCRIPTION π¦
okay so here's the tea β β audiowaveform generates waveform data from audio files in MP3, WAV, FLAC, Ogg Vorbis, or Opus format. and what is waveform data for? it's for producing a visual rendering of the audio β the same kind of look you'd see in an audio editing app. literally so satisfying to look at. π
waveform data files get saved in either binary format (.dat) or JSON (.json). and here's the cute part β if you hand it an input waveform data file, audiowaveform can also render the audio waveform as a PNG image at a given time offset and zoom level. main character energy. π
so how does the waveform data actually come out of the audio signal? bestie, i'm so glad you asked:
- first it combines the input channels to produce a mono signal
- then it computes the minimum and maximum sample values over groups of N input samples β where N is controlled by either the
--zoomor the--pixels-per-secondoption β such that each N input samples produces one pair of minimum and maximum points in the output
every N samples = one min/max pair. slay. πΈ
and if you want the nitty gritty on the binary and JSON waveform data file formats? go read audiowaveform(5). it's giving lore. π
β¨ OPTIONS β¨
okay bestie, buckle up, this is the long one but every single flag matters. π
--helpβ shows the help message. the "hello, what do you do" flag. π--version,-vβ shows version information. the "who are you and when were you born" flag. π--quiet,-qβ disables status messages. for when you want silence and peace. π€«--input-filename,-i <filename>β the input filename! it should be a MP3, WAV, FLAC, Ogg Vorbis, or Opus audio file, or a binary or JSON format waveform data file. by default,audiowaveformuses the file extension to decide how to read it β so either.mp3,.wav,.flac,.ogg,.oga,.opus,.dat, or.jsonas appropriate β but bestie, you can override all that with the--input-formatoption. and if--input-filenameis-or is omitted,audiowaveformreads from standard input, and then the--input-formatoption must be used to specify the data format. no guesswork allowed. π€
heads up babes: Opus support requires libsndfile 1.0.29 or later, so it may not be available on all systems. fr fr check your version before you come for me. π
--output-filename,-o <filename>β the output filename! which may be either a WAV audio file, a binary or JSON format waveform data file, or a PNG image file. by default,audiowaveformuses the extension to decide what kind of output to generate β.wav,.dat,.json, or.pngas appropriate β but again, override with--output-formatif you're feeling spicy. and if--output-filenameis-or is omitted,audiowaveformwrites to standard output, and the--output-formatoption must be used to specify the data format. π--input-format <format>β the input data format, eitherwav,mp3,flac,ogg,opus,dat, orjson. this option must be used when reading from standard input. it may also be used to set the input file format instead of letting it be determined from the file extension from the--input-filenameoption. β¨--output-format <format>β the output data format, eitherwav,dat,json, orpng. this option must be used when writing to standard output. it may also be used to set the output file format instead of letting it be determined from the file extension from the--output-filenameoption. πΈ--zoom,-z <zoom>(default:256) β when creating a waveform data file or image, specifies the number of input samples to use to generate each output waveform data point. π note: this option cannot be used if either the--pixels-per-secondor--endoption is specified. and when you're creating a PNG image file, a value ofautoscales the waveform automatically to fit the image width. iconic behavior honestly. π§--pixels-per-second <zoom>(default:100) β when creating a waveform data file or image, specifies the number of output waveform data points to generate for each second of audio input. π note: this option cannot be used if either the--zoomor--endoption is specified. pick a lane bestie. π--bits,-b <bits>(default:16) β when creating a waveform data file, specifies the number of data bits to use for output waveform data points. valid values are either8or16. that's it, that's the list. π―--split-channelsβ output files are multi-channel, not combined into a single waveform. the way that it just keeps every channel separate?? obsessed. π¦--start,-s <start>(default:0) β when creating a waveform image, specifies the start time, in seconds. β±οΈ--end,-e <end>(default:0) β when creating a waveform image, specifies the end time, in seconds. β²οΈ note: this option cannot be used if the--zoomoption is specified. sorry babe, them's the rules. π--width,-w <width>(default:800) β when creating a waveform image, specifies the image width. π--height,-h <height>(default:250) β when creating a waveform image, specifies the image height. π (yes,-his height here, not help β stay woke π)--colors,-c <colors>(default:audacity) β when creating a waveform image, specifies the color scheme to use. valid values are either:audacityβ generates a blue waveform on a grey background, similar to Audacityauditionβ generates a green waveform on a dark background, similar to Adobe Audition
aesthetic choices, both valid. π¨
--border-color <rrggbb[aa]>β when creating a waveform image, specifies the border color. if not given, the default color used is controlled by the--colorsoption. the color value should include two hexadecimal digits for each of red, green, and blue (00toFF), and optional alpha transparency (00toFF). so like, hex codes bestie. π--background-color <rrggbb[aa]>β when creating a waveform image, specifies the background color. if not given, the default color used is controlled by the--colorsoption. πΌοΈ--waveform-color <rrggbb[aa]>[, <rrggbb[aa]>, ...]β when creating a waveform image, specifies the waveform color. if not given, the default color used is controlled by the--colorsoption. and plot twist: this option accepts multiple comma-separated color values, which are used with the--split-channelsoption to produce a waveform image with multiple channels. so you can make it all rainbow. π--axis-label-color <rrggbb[aa]>β when creating a waveform image, specifies the axis labels color. if not given, the default color used is controlled by the--colorsoption. πΈ--with-axis-labels,--no-axis-labels(default: with axis labels) β when creating a waveform image, specifies whether to render axis labels and image border. on or off, your call. β¨--amplitude-scale <scale>(default:1) β when creating a waveform image or waveform data file, specifies an amplitude scaling (or vertical zoom) to apply to the waveform. must be either a number orauto, which scales the waveform to the maximum height. π--waveform-style <style>(default:normal) β when creating a waveform image, specifies how the waveform is drawn. valid values are either:normalβ draws a normal waveformbarsβ draws the waveform as vertical bars
bars mode is so cute, highly recommend. π₯
--bar-width <width>(default:8) β when creating a waveform image with the--waveform-style barsoption, specifies the width of each bar, in pixels. π--bar-gap <width>(default:4) β when creating a waveform image with the--waveform-style barsoption, specifies the separation between each bar, in pixels. πΈ--bar-style <style>(default:square) β when creating a waveform image with the--waveform-style barsoption, specifies how each bar is drawn. valid values are either:squareβ draws the waveform bars with square cornersroundedβ draws the waveform with rounded corners
rounded is giving cozy. π
--compression <level>(default:-1) β when creating a waveform image, specifies the PNG compression level. must be either-1(default compression) or between0(fastest) and9(best compression). trade-offs, bestie. βοΈ--raw-samplerate <rate>β when using raw input audio format, this must be set to the appropriate sample rate, in Hz. β°--raw-channels <n>β when using raw input audio format, this must be set to the appropriate number of channels. ποΈ--raw-format <format>β when using raw input audio format, this must be set to the appropriate sample format. valid options ares8,u8,s16le,s16be,s24le,s24be,s32le,s32be,f32le,f32be,f64leandf64be. yes, all twelve of them, count 'em. π (also the original had a lil double space befores8, but we fixed the vibes not the facts π)
π EXAMPLES π
this is the part where it gets fun. copy-paste away bestie. π
generate waveform data from an MP3 file, at 256 samples per point with 8-bit resolution:
audiowaveform -i test.mp3 -o test.dat -z 256 -b 8
generate waveform data containing multiple channels, rather than combining all channels into a single waveform:
audiowaveform -i test.mp3 -o test.dat -z 256 -b 8 --split-channels
generate waveform data in JSON format from a FLAC file, at 256 samples per point with 8-bit resolution:
audiowaveform -i test.flac -o test.json -z 256 -b 8
generate a 1000x200 pixel PNG image from a waveform data file, at 512 samples per pixel, starting at 5.0 seconds from the start of the audio:
audiowaveform -i test.dat -o test.png -z 512 -s 5.0 -w 1000 -h 200
generate a 1000x200 pixel PNG image from a waveform data file, starting at 5.0 seconds from the start of the audio, ending at 10.0 seconds:
audiowaveform -i test.dat -o test.png -s 5.0 -e 10.0 -w 1000 -h 200
generate a 1000x200 pixel PNG image from a waveform data file, at 200 pixels per second, starting at 5.0 seconds from the start of the audio:
audiowaveform -i test.dat -o test.png --pixels-per-second 200 -s 5.0 -w 1000 -h 200
generate a 1000x200 PNG image directly from a WAV file, at 300 samples per pixel, starting at 60.0 seconds from the start of the audio:
audiowaveform -i test.wav -o test.png -z 300 -s 60.0 -w 1000 -h 200
generate a 1000x200 PNG image from an MP3 file, showing the entire duration:
audiowaveform -i test.mp3 -o test.png -w 1000 -h 200 -z auto
generate a 1000x200 PNG image from an MP3 file, using a custom bar style:
audiowaveform -i test.mp3 -o test.png -w 1000 -h 200 -z auto --waveform-style bars --bar-width 10 --bar-gap 2
generate a waveform data file from standard input, to standard output, using ffmpeg to convert a video file to WAV format:
ffmpeg -i test.mp4 -f wav - | audiowaveform --input-format wav --output-format dat -b 8 > test.dat
π‘ Note: if you want to render multiple images from the same audio file, it's generally preferable to first create a waveform data (.dat) file, and create the images from that β because decoding long MP3 files can take significant time. bestie please don't make your laptop suffer. π
convert a waveform data file to JSON format:
audiowaveform -i test.dat -o test.json
convert MP3 to WAV format audio:
audiowaveform -i test.mp3 -o test.wav
π LIMITATIONS π
the audiowaveform program has the following limitations, and yes we're saying them out loud:
- when generating PNG images, the maximum audio sample rate is 50,000 Hz. β οΈ
- when generating PNG files, it is not valid to specify a zoom level smaller than that used to generate the input waveform data file. π«
π₯ SEE ALSO π₯
audiowaveform(5) β go read it, it's the whole format lore. π
π«Ά AUTHOR π«Ά
Chris Needham β thank you for this icon, we stan. π
and that's the whole page bestie!! πβ¨ this lil rewrite is from audiowaveform(1) in the General Commands Manual, dated 23 January 2024 β so if anything's changed since then, blame the calendar not me. π mwah, go make some pretty waveforms. π¦
π¦ where this page comes from
- nixos 26.05: audiowaveform 1.10.3
- nixpkgs unstable: audiowaveform 1.10.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms