19 Jun '13 - 19:00 *
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: Recording sounds from speaker in VB6  (Read 726 times)
vbguyny
Posts: 5


« on: 6 Apr '12 - 02:18 »
Reply with quoteQuote

I see that you provide an example written in VB6 which records the audio which goes to the speakers to a stream and from there to disk.  However I only want to start recording only if there is something to record (no silence).  And then record for 0.5 seconds, stop, and then wait again.  Any ideas?

Thanks,
-Mike
Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #1 on: 6 Apr '12 - 15:37 »
Reply with quoteQuote

You can check the level of the sample data received in your RECORDPROC function, and don't start writing the data to disk until it reaches some threshold. You can then stop writing 0.5s after that, and wait for the threshold again.
Logged
vbguyny
Posts: 5


« Reply #2 on: 7 Apr '12 - 03:04 »
Reply with quoteQuote

@Ian: Thanks for your response.  I found out how I can setup the callback function in VB6 to get the data pointer but how do I test whether or not the data that the pointer is pointing too is above the threshold?  Are you able to provide an example?
Logged
gnag
Posts: 160


« Reply #3 on: 7 Apr '12 - 11:03 »
Reply with quoteQuote

You could use Utils.GetLevel which calculates a Level of the Sample Buffer for you, you could also take an Average of the Samples Absolute Value (No Signs!) or use RMS to get an Information about the Level. I think the easiest is to use GetLevel , be sure to check the Documentation here to understand the returned Values.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines