Menu

#102 [PATCH] modified spectrogram hh:mm:ss in X-axis

open
nobody
None
5
2022-08-19
2014-10-31
dettox
No

modified spectrogram.c, added option "-g", show time tick labels in hh:mm:ss when the tick is in seconds, you can find the patch as attachment

1 Attachments

Discussion

  • dettox

    dettox - 2014-11-03

    here a screenshot of the usage and the new help:

    $sox --help-effect spectrogram

    sox: SoX v14.4.2

    Effect usage:

    spectrogram [options]
    -x num X-axis size in pixels; default derived or 800
    -X num X-axis pixels/second; default derived or 100
    -y num Y-axis size in pixels (per channel); slow if not 1 + 2^n
    -Y num Y-height total (i.e. not per channel); default 550
    -z num Z-axis range in dB; default 120
    -Z num Z-axis maximum in dBFS; default 0
    -q num Z-axis quantisation (0 - 249); default 249
    -w name Window: Hann(default)/Hamming/Bartlett/Rectangular/Kaiser/Dolph
    -W num Window adjust parameter (-10 - 10); applies only to Kaiser/Dolph
    -s Slack overlap of windows
    -a Suppress axis lines
    -r Raw spectrogram; no axes or legends
    -l Light background
    -m Monochrome
    -h High colour
    -g X-axis time in hh:mm:ss format
    -p num Permute colours (1 - 6); default 1
    -A Alternative, inferior, fixed colour-set (for compatibility only)
    -t text Title text
    -c text Comment text
    -o text Output file name; default `spectrogram.png'
    -d time Audio duration to fit to X-axis; e.g. 1:00, 48
    -S position Start the spectrogram at the given input position

     

    Last edit: dettox 2014-11-03
  • Martin Guy

    Martin Guy - 2022-08-19

    This has several issues:
    - it doesn't apply cleanly to the git master HEAD
    - the formatting doesn't match the exiting code
    - the compiler reports that "i" may be used uninitialized at line 915 (tick=i/10) and the later "Tick label" line. Use of i here, left over from the end of a previous loop, is bizarre.
    - I've tried applying the failed patch (to spectrogram.c) manually to git master HEAD, but the x-axis ticks remain in seconds, and "Time (s)" is replaced by the file length in HMS format (that's probably my fault in misapplying it)

    I suggest this be closed until these issues are addressed

     

    Last edit: Martin Guy 2022-08-19

Log in to post a comment.