Re: Find loudest time in audio file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Stuart Bruce <stuartrbruce@xxxxxxxxx> [2016-03-26 18:58]:
> On 24 March 2016 at 14:50, Peter P. <peterparker@xxxxxxxxxxxx> wrote:
> 
> > * Stuart Bruce <stuartrbruce@xxxxxxxxx> [2016-03-24 14:28]:
> > > I've figured out how to identify the highest amplitude, but I'm
> > > specifically after information about where within the sound that
> > amplitude
> > > happens.
> >
> > Do you mean momentary amplitude as in 'highest peak of the waveform', or
> > do you mean highest RMS amplitude in a certain, possibly short, time
> > window?
> >
> 
> The former. I'm specifically after the time position of the single highest
> peak of the waveform- or, if there are multiple equal peaks, the first one
> of them.

That could be done with three lines of GNU Octave[1]

Read the audiofile into a vector y (in the case of a stereo file it will
be a matrix):
	y = audioread("fluteFlzAperiodicoBar18-2.wav");	

check the size (number of samples in y):
	size(y)

and get the amplitude of the largest single sample into the variable
maxVal (which gives two values if you are working in stereo), and maxPos
which gives the position of these peaks in samples (check your
samplerate to convert this to seconds)
	[maxVal, maxPos] = max(y)

done! :)
P

[1] www.gnu.org/software/octave

------------------------------------------------------------------------------
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



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux