Advertisement

real time sound information

Started by January 14, 2003 10:31 PM
2 comments, last by russjman 22 years, 1 month ago
I am trying to create a 3d virtual world that changes according to sound information; like amplitude, frequency, or pitch. Similar to Winamp Visualizations. I was wondering if anyone one had any advise as to how I might go about this process in OpenGL.
Solution 1) use some library (bass.dll, fmod.dll, etc) - do your research and you can probably get off easy

Solution 2)
Okay - first off, chill. I''m sorry if I''m wrong, but you seem to be a newbie, so I''ll presume you don''t really know what you''re talking about No hard feelings, right?

>> I am trying to create a 3d virtual world that changes according to sound information;

A very neat idea, go for it. Just read the next couple of paragraphs first, though...

>> I was wondering if anyone one had any advise as to how I might go about this process in OpenGL.

Note that OpenGL is a Graphics Library and inherently doesn''t have anything to do with sound - you might equally as well use DirectX or Assmebly to do the job directly.

Anyway, OpenGL, in this instance, is the least of your worries. Anyone can make vertices move accoriding to some data or some system output (also data, but can be modified by different parameters and therefor is not static). Before you get to the easy (read: fun) part, though, read the following section.

>> like amplitude, frequency, or pitch. Similar to Winamp Visualizations.

This is the hard part - you cannot extract this type of information from a sound buffer without quite a bit of knowledge in the fields of mathematics and physics - unfortunately this is something you must learn from books because makeshift online sites won''t really give you an adequate background. There are a few solutions - some easier, some more difficult. However, only one qualifies for realtime use - it''s called DFT or Discrete Fourier Transform. You won''t be able to undrstand it without a certain amount of background knowledge in DSP (Digital Sound Processing). Another keyword to search for is FFT (Fast Fourier Transform). This is a relatively complex mathematical procedure to analyze a signal after which you have the raw set of base sinusoids that make up the signal (this is where you get your information). These sinusoids can then be modified in some fashion to change the output signal, or used for any applications you might think of and convolved (synthesized) back to the resltant signal through Inverse Fourier Transform. Think twice before you tackle this kind of a problem and don''t want to do quite a bit of reading. Don''t think at all and grab a book if you think you might find this (DSP) fascinating because it is.

Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Advertisement
guilty as charged.....yes i am a newbie. Thanks for the advice....i was able to find bass.lib along with some documentation. This is going to keep up to my armpits for a while. any more info in the subject would me most appreciated....especially for implementing the bass library. Thanks a bunch.
I''m presuming you downloaded the entire Bass "SDK" from its homepage. It contains a sample program showing how to create a live spectrum from an audio stream - this is what you''re looking for. Note that the spectrum by default changes according to music, so playing some fast track and morphing the world according to it might not look very much what you wish for. Explore the spectrum falloff value.

Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared

This topic is closed to new replies.

Advertisement