CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2005
    Posts
    1,828

    recognize a .WAV File

    I need to develop an application in VC++ that will take .WAV files as an input and identify if there is a Gun shot in that wave file. WAVE file with gunshot must be having certain paramaters like frequency, bit rate etc which I don't know right now. But is there a way in VC++ to develop a program that can recognize gunshots by comparing that .WAV file with certain parameters?

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: recognize a .WAV File

    Short answer:
    yes.

    Reality answer:
    analyzing sound is a very complex undertaking, and identifying some wav file as having an actual gunshot vs something that has a sort of similar audible pattern (hitting a drum, hitting a baseball with a bat, slamming a door shut, clapping your hand, ...) is going to take advanced algorithms. And a lot of complex math.

    If you are happy enough with signalling a file as "this could maybe have a gunshot, needs a human to listen to make sure", then you can probably take somewhat of a shortcut by trying to spot a high volume spike. But that may not work well if the gunshot is further away or muffled or the entire wav file is silenced or improperly scaled.

  3. #3
    Join Date
    Apr 2005
    Posts
    1,828

    Re: recognize a .WAV File

    Is it possible that we take 3rd party library (free / paid) to whome we can pass wave file as input, that library analyzing it and compare it with some standard gunshot files and display the output?

  4. #4
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: recognize a .WAV File

    maybe... I don't know of such library.

    In practice, I can say that those "sound analyzing software" you often see used on TV shows that within seconds can do those "amazing things", in practice don't exist. Or at least don't exist in the way you see on TV. Most sound analysis requires a trained specialist to "guide" the software. Not the other way around.

    That said, yes, there are tools that pick up certain patterns in sound. Whether they can recognize a gunshot vs something else. I can't say for sure. Just know that a LOT of things affect sound.
    ambient sounds in the area (cars, people, birds, wind, ...), echo's, doppler effect, sound being distorted by surrounding buildings etc. quality of the recording...


    Even if you take a wav of ambient sound outdoors. and you mix in an actual soundsample, even at the proper speed. Trying to have some bit of software pick up that sound in the sample will be a challenge, let alone if the sound sample and the actual sound you're analyzing aren't 100% identical.

    I'm not going to say "impossible". But I can say "not likely". If any such software does exist to do it automatically, it's probably going to be quite expensive.
    Software that will help a trained specialist work through large amounts of audio data for potential gunshots (or something else) faster, to be verified by a human on the other hand does exist and even comes in freeware.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured