Get FFT Values from ofVideoPlayer Sound

Hi,

For an idea I have in mind I have to analyse the sound of a video. looking throgh ofVideoPlayer i could not really find anything that would do so. is there an more or less easy way of getting the sound FFT values from a video?

Thanks,

moka

no ideas?

otherwise I will propably load the sound seperately. but that would be a crappy solution.

currently, there is no way, on mac / pc to get the current sound buffer the same way you can, say, get the current image info, ie getPixel(). I’m not sure how hard that would be – This is a cheap hack, but could work – if you are on a mac, you can simply try routing your sound output to your input by using soundflower. I’m sure there is a similar kind of thing on a pc as well… then, you can write your fft code against audio input.

hope that helps!
zach

I don’t know the of-internals, but if you use quicktime for playback and can get the movie-reference out of ofVideoPlayer you can use

GetMovieAudioFrequencyLevels

to get the current FFT-Levels. See http://developer.apple.com/qa/qa2005/qa1459.html for more info.

Cheers,
Stephan

[quote author=“zach”]currently, there is no way, on mac / pc to get the current sound buffer the same way you can, say, get the current image info, ie getPixel(). I’m not sure how hard that would be – This is a cheap hack, but could work – if you are on a mac, you can simply try routing your sound output to your input by using soundflower. I’m sure there is a similar kind of thing on a pc as well… then, you can write your fft code against audio input.

hope that helps!
zach[/quote]

hey Zach, I actually thought about that too. But that might get me in trouble if it’s not rendered at stable FPS, not sure though.

Sth, that looks like a better way to go of I can get that to work!

Thanks I will check that out, any more hints welcome :slight_smile: