Sound (wave) Detection

Hi, thank you for entering and trying to help me.
What I need to do is make an application that opens an audio file format(.mp3,.wav,.wma,etc..) that will most likely play frequencies, then if it detects a sound wave(frequency) it will flash the application window.

I made some research and asked my brother for help, he gave me a book about Qt(Qt is a framework for developing GUI applications) and Im getting the hang of it, I find it extremely useful and easy-to-use. I think I will be able to do the GUI part of the application and it will be a somewhat easy application to do.
The problem is that I dont know how to detect a sound wave, I dont know about any function that comes with the STL of C++, so I thought I would post here in case somebody knows a library or function that can detect audio

Something like this:

1
2
3
4
5
6
if(SoundLib::there_is_sound())
{
    connect(&app, SIGNAL(there_is_sound),
            &app, SLOT(there_is_sound());
)
}


where SoundLib is the sound library, Sound::there_is_sound() a function in the library. The connect() function is part of the Qt library, it connects a signal with a slot(somewhat like a function).

If anyone knows a library that works different could they please give an example of its use.

Thank you for taking the time to read this.

PS:I only need to know how to detect if there is a sound wave, but I would also like to know how it works. Also if somebody knows how to install a library(make it available in any C++ file, just like the STL) could they please tell me. Thanks
Last edited on
So let me get this straight, you want a program to play an audio file then flash in the taskbar when...??? When what happens exactly?

Second most important question about your question is what OS do you plan on using for this application? Don't even think about trying to do it cross-platform, honestly its a very professional approach but we are way too early in the design phase for this so pick a platform that you are comfortable with first.

This is a much more advanced question then you may think since few OS API's allow direct communication from software to the hardware.
Don't even think about trying to do it cross-platform


WTF is this advise? Why are you discouraging cross-platform? Espeically when he's already using a crossplatform lib (Qt)

seriously... wtf?


Anyway, Sismetic:

There's always a sound wave. Whether or not anything is audible is another story, and would take some very simple DSP work, even if you have a lib to access the sound.

I don't know of many libs that accept audio input, as I mostly use audio output. But possible (cross platform) options you can look at are:

1) OpenAL
2) Fmod
3) ?SDL? (don't know if it has audio input, and I'm not even sure if it's a wise decision if it does)

Since "detecting if there's a sound" isn't a typical thing, and it's very subjective, there probably isn't going to be a there_is_sound() function in any lib. You will need to do it yourself.

So yeah, get a sound lib and record some audio input. One you have some audio data, you can examine it to see whether or not the audio is silence, or whether or not some kind of audible noise was made.

How to examine is another story, but let's just start with one hurdle at a time.
Last edited on
@ Disch: I am keeping project goals realistic, you know modular development and all of those buzz phrases that we pretend not to know the meaning of to avoid explaining them to people. I go on to explain myself already there is no need to make it seem like I was discouraging the OP. Also why would he play the system sound out of the speaker just to have (I assume) a mic pick it up and reprocess it? This seems to be what the OP wants but how do you know that he is taking the best approach?

EDIT: I see, I didn't type "at first" so now I look like a bad guy. Really though? I know I haven't been here in a minute but you couldn't have assumed that I meant at first?
Last edited on
I am keeping project goals realistic


What on Earth is so unrealistic about using a cross platform lib for audio? A lot of libs are even simpler to use than the OS specific APIs.

I go on to explain myself already there is no need to make it seem like I was discouraging the OP.


"Don't even consider" is pretty discouraging.

A lot of my objection was with how dismissive you sounded. Granted that may not have been your intent, but it's how it came across to me.

Especially since it was directed at someone who was already attempting crossplatform, which is a rare quality that should be openly embraced and encouraged.

EDIT: I see, I didn't type "at first" so now I look like a bad guy. Really though? I know I haven't been here in a minute but you couldn't have assumed that I meant at first?


Even if I assumed that, it's still terrible and misleading advise, IMO.


EDIT:

I should stop posting when I'm at work. I think I'm being too short and a big asshole due to the stress. XD

You didn't deserve me snapping at you like that, Computergeek.

I still don't agree with what you said, but I should've been more mature and respectful in my response.

I'm sorry.
Last edited on
Topic archived. No new replies allowed.