View Full Version : there is a plugin to extract audio frequency?
ang3l
15th March 2012, 16:40
with MinMaxAudio.dll i can extract db info for each frame
LoadPlugin("MinMaxAudio.dll")
a = DirectShowSource ("movie.avi",video=false)
v = BlankClip(width=2,height=2,length=60000,fps=23.976)
w = audiodub(v,a)
w
WriteFileIf(last,"movie.log","(AudioRMS( 0) < -65)","string(current_frame)",append=true)
there is a plugin that work in this way but with audio frequency hz?
or do you know a command line prog that extract this info in a txt file
secs frequency and power
thx
Selur
15th March 2012, 17:20
may be sox (http://sox.sourceforge.net/Main/HomePage) can do something like that,...
LoRd_MuldeR
15th March 2012, 18:37
http://avisynth.org/mediawiki/Clip_properties
AudioRate (clip)
Returns the sample rate of the audio of the clip (type int).
Other than that, SoX (in "--i" mode) will do the job for Wave files and some other audio formats.
For the rest use MediaInfo, which handles almost everything that exists...
[EDIT]
Or do you want to have something like a spectrogram? Then you would need to do a Fourier Analysis!
But that doesn't give you "the frequency". Instead it gives you the "intensity" of each frequency for a given frame.
In other words: It is 3D data with a "time", "frequency" and "intensity" axis...
You may use openSMILE:
http://opensmile.sourceforge.net/
ang3l
15th March 2012, 20:19
i need something like spectrogram but without graph
only number , secs and frequency
this is for matching 2 audio of a movie with different language
like in shazam algorithm but to find corrispondence in two wav file
edit
for example
i made two pic of a part of two wav spectrogram
I highlighted the ringing of a phone
http://i40.tinypic.com/2wnpvt4.png
http://i41.tinypic.com/33vi0zb.png
i need to extract the numbers that are used to draw this spectrogram to analyse and find more similar point in two track automatically
LoRd_MuldeR
15th March 2012, 20:23
i need something like spectrogram but without graph
only number , secs and frequency
this is for matching 2 audio of a movie with different language
like in shazam algorithm but to find corrispondence in two wav filei need to extract the numbers that are used to draw this spectrogram to analyse and find more similar point in two track automatically
I think openSMILE has all you need:
You can read a Wave file as input with the "waveSource" component, cut it into fixed-size frames (overlapping or not) with the "framer" component, calculate the frequency spectrum of each frame with the "transformFFT" component and finally dump everything to a text file the "cvsSink" component. You may want to insert the "FFTmagphase" component after "transformFFT" to get the magnitudes and phases instead of complex FFT coeffs.
http://sourceforge.net/projects/opensmile/files/openSMILE_book_1.0.0.pdf/download
ang3l
15th March 2012, 22:11
@LoRd_MuldeR
thx :)
i think i'm on the right way
this is my config file
[componentInstances:cComponentManager]
instance[dataMemory].type = cDataMemory
instance[waveSource].type = cWaveSource
instance[framer].type = cFramer
instance[transformFFT].type = cTransformFFT
instance[fFTmagphase].type = cFFTmagphase
instance[csvSink].type = cCsvSink
printLevelStats = 0
nThreads = 1
[waveSource:cWaveSource]
writer.dmLevel = wave
period = 0
; filename = input.wav
filename = c:\smile\input.wav
monoMixdown = 1
/////////////////////////////////
// 25fps
[framer:cFramer]
reader.dmLevel = wave
writer.dmLevel = waveframes
copyInputName = 1
frameMode = fixed
frameSize = 0.04000
frameStep = 0.04000
frameCenterSpecial = left
noPostEOIprocessing = 1
///////////////////////////////////
// fft
[transformFFT:cTransformFFT]
reader.dmLevel = waveframes
writer.dmLevel = fftc
// nameAppend =
copyInputName = 1
processArrayFields = 1
inverse = 0
////////////////////////////////
// magphase
[fFTmagphase:cFFTmagphase]
reader.dmLevel = fftc
writer.dmLevel = fftmag
// nameAppend =
copyInputName = 1
processArrayFields = 1
inverse = 0
magnitude = 1
phase = 1
////////////////////////////////
// csv
[csvSink:cCsvSink]
reader.dmLevel = fftmag
filename = c:\smile\output.csv
delimChar = ;
append = 0
timestamp = 1
number = 1
printHeader = 1
i used cframer to cut like 25 fps
and this work
then i used cTransformFFT and cFFTmagphase
to calculate frequency spectrum
now when i open output.csv there is a 2000 column of number with pcm_mag from pcm_mag[0] to pcm_mag[1024]
and pcm_phase[0] to pcm_phase[1024]
i'm not very expert in audio things
there is a way to simplify these data?
LoRd_MuldeR
15th March 2012, 22:21
there is a way to simplify these data?
In what way? You said you want the spectrum in a text file and now you have that...
(Though it is probably sufficient to look at the pcm_mag[] array, which should contain the magnitudes)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.