Stuart Bruce <stuartrbruce@xxxxxxxxx> wrote: > Is there a way in Sox's stats functions to find the loudest part of an > audio file, but to return the *time* of that loudest point, rather than > just the amplitude of it? > > I've figured out how to identify the highest amplitude, but I'm > specifically after information about where within the sound that amplitude > happens. I wrote dtas-partstats for this purpose (at least down to a 10s interval), part of the gigantic dtas[1] which isn't really documented, yet. dtas-partstats divides the file into 10-second intervals, runs the sox "stats" effect for each part, and generates a text file output with the stats for each time interval on each line. General usage is: dtas-partstats INFILE >OUT.txt The first column shows the start of the 10s interval, and the second column shows the overall peak, so you can sort by the 2nd column to locate the interval where the peak is: sort -k2,2rn OUT.txt | $PAGER I normally find 10 seconds to be a sufficient interval for finding peaks in recordings, but I plan to add an option to allow adjusting that interval as well as supporting CSV output at some point... Once I find the 10-second interval where a peak occurs, I can focus on it with the "trim" effect in sox. Unfortunately, dtas is implemented in Ruby so it may not be easy to install: [1] http://dtas.80x24.org/ - http://dtas.80x24.org/INSTALL At least the description I gave might also be helpful in implementing your own script to do this. (dtas is just wrapper scripts around sox or ecasound or whatever-else scripting-friendly) Disclaimer: I'm the dtas maintainer and do not like promoting my projects at all, but I figured it might be helpful in this case... ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140 _______________________________________________ Sox-users mailing list Sox-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/sox-users