detect sound wave-VBForums
Results 1 to 8 of 8

Thread: detect sound wave

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    4

    detect sound wave

    Help !!! Anyone could tell me how to detect the silent period (no output of sound card)..
    Thanks

  2. #2
    Addicted Member Vegeta's Avatar
    Join Date
    Jul 2002
    Posts
    159

    Re: detect sound wave

    you mean you want a trigger, that fires if there is no data in the output buffer of the sound driver, or simply check it manually?

  3. #3
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,074

    Re: detect sound wave

    I'm sure it has something to do with these wave API's found in this API listing:

    http://www.mentalis.org/apilist/w.shtml

    But I'm sure DirectSound is capable of it. Just never pulled it off before:

    http://directx4vb.vbgamer.com/DirectX4VB/TUT_DX8_DA.asp

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    4

    Re: detect sound wave

    Quote Originally Posted by Vegeta
    you mean you want a trigger, that fires if there is no data in the output buffer of the sound driver, or simply check it manually?
    Yes, I want to trigger the other program if there is no output of sound card. Have any idea to write the VB code?

  5. #5
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,074

    Re: detect sound wave

    If I known, I would have an example program made out for ya. PM CVMichael on this, as he is our DirectSound expert.

  6. #6
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,728

    Re: detect sound wave

    I saw this thread without getting hte PM (This time)

    It should be easy to do, you just record the sound at all times, and make an average of the sound buffer, if it's under a certain percentage (you usually have some static), then execute the triger.

    I don't have time to do it now, but I'll try to write some code later (today hopefully).

    For how long do you think the silence interval will be ?
    And how precise it has to be ?

  7. #7
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,728

    Re: detect sound wave

    OK, here it is...

    In the DXRecord_GotWavData Sub, Modify the constants SilencePercent and NonSilencePercent to the values you need.

    Put the code that executes the other program in the tmrExecute_Timer sub.

    [Edit]
    I changed the attachment, I added an "Extended" version, I think you might like it
    Attached Files Attached Files
    Last edited by CVMichael; Nov 21st, 2005 at 01:56 PM.

  8. #8
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,728

    Re: detect sound wave

    So.. no feedback at all ?

    Is it OK what I did or not ?

    Is your problem solved ?

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.