21 May '13 - 15:39 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Getting the volume of what's playing at this exact instant...  (Read 439 times)
Raptisoft
Posts: 23


« on: 25 Apr '12 - 00:12 »
Reply with quoteQuote

Hi all,

I have a sound sample-- it's voice.  It's broken up with small areas of silence.  I have a graphic character who moves his head while speaking (but not mouth sync or anything, just head bobbing).  I'd like to stop him from bobbing his head when the current volume of the voice sample is lower than a threshold.  Is there any kind of BASS query I could do to get the current instanced volume (or wave size, or whatever I might do to detect areas of near silence) of a sample that's playing?

Thanks
John
Logged
Ian @ un4seen
Administrator
Posts: 15253


« Reply #1 on: 25 Apr '12 - 15:57 »
Reply with quoteQuote

Will the voice ever be played more than once at a time? If not, perhaps you could use a stream instead of a sample to play it, ie. BASS_StreamCreateFile instead of BASS_SampleLoad. You would then be able to use BASS_ChannelGetLevel to get the current level of the stream. Unfortunately, BASS_ChannelGetLevel doesn't currently support sample channels (HCHANNEL).
Logged
Raptisoft
Posts: 23


« Reply #2 on: 27 Apr '12 - 00:30 »
Reply with quoteQuote

As a matter of fact, it IS a stream, so this works out perfectly. Smiley

Thanks!
Logged
Ian @ un4seen
Administrator
Posts: 15253


« Reply #3 on: 27 Apr '12 - 14:22 »
Reply with quoteQuote

That's handy Smiley

For completeness, I'll go ahead and add support for sample channels (HCHANNEL) in BASS_ChannelGetData/Level for the next release anyway.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines