[LAU] sndfile-waveform PNG generator ?

Robin Gareus robin at gareus.org
Tue Jan 10 20:32:08 UTC 2012


On 01/10/2012 08:42 PM, Tim Orford wrote:
> On Tue, Jan 10, 2012 at 03:38:39PM +0100, Robin Gareus wrote:
>> [...]
>> It's also pretty straight-forward in C; but before whipping up
>> `sndfile-waveform`, I'd thought I ask around.
> 
> Hi Robin
> 
> I'm trying to wrap up a first release of 'libwaveform'
> which mostly outputs to opengl using textures or shader
> programs, but I could add a PNG output tomorrow if you
> are interested. What command line args do you need?

Hi Tim,
dreaming up --help:

Usage: snd2png <audio-file-name>
Options:
  -o <filename>  write PNG to file instead of STDOUT
  -w             width in pixels (default 800)
  -h             height in pixels (default 192)

maybe:
  -A             annotate axes with sample-number (X), value (Y).
                 add info-box: sample-rate, bit-format.
  -c             foreground color (RGBA) 0x000000ff (black)
  -C             background color (RGBA) 0xffffff80 (semi transp white)

maybe later:
  -l             log-scale
  -r             rectified waveform shape
  -F <font>      specify font for annotations
  -t <fps>       use timecode instead of sample-numbers for x-axis
  -T             timecode start-offset - override BWF header info
  -M             add meta-data to annotations.
  -f             FFT analyze, colour highlight peak freq.

In general: keep it professional (scientific) and simple.

I've been thinking of throwing some time at forking sndfile-spectrogram
which already has all required infrastructure (and more). I don't think
a dedicated libwaveform is needed. It's pretty straight forward, isn't
it? I was actually surprised that there's actually no sndfile-waveform
tool, yet! -- Yeah right. It's a gimmick :)


> While I am posting to the list, I would like to improve
> the antialiasing and shading;

AFAIK you can use cairo-surface as OpenGL-textures.

> does anyone have any
> particularly good examples of waveform displays that
> could be used for inspiration? (could be movie screenshots,
> applications, whatever...)

Nope, none that you would not already know.
That reminds me: How are things going with SampleCat?

> Regards
> --
> Tim Orford

greetings,
robin


More information about the Linux-audio-user mailing list