MultiMedia Soft forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

SMF - Just Installed!

Author Topic: Line level detection for audio recording  (Read 3061 times)

NadiaDj

  • Newbie
  • *
  • Posts: 4
    • View Profile
Line level detection for audio recording
« on: August 02, 2014, 12:24:50 PM »

Hi,

I need to create an application that automatically records audio from a line input. This is all pretty straight forward with your audio recorder component but what I need is to detect the audio level BEFORE the recording is started, so I need to monitor the line input and, if the signal raises above a certain level, I need to start the recording session. Is this possible with one (or a combination) of your products? I see that I could monitor VU levels during a recording, but can I do the same before the recording starts?

Thanks in advance

Nadia
Logged

Administrator

  • Administrator
  • Full Member
  • *****
  • Posts: 231
    • View Profile
    • MultiMedia Soft
Re: Line level detection for audio recording
« Reply #1 on: August 02, 2014, 12:36:19 PM »

Hello Nadia,

what you request is quite simple to develop; when you need to start monitoring the input device, please, do the following:

- set the EncodeFormats.ForRecording property to ENCODING_FORMAT_NOFILE

- start a dummy recording session through one of the recording start methods (StartFromDirectSoundDevice or StartFromAsioDevice or  StartFromWasapiCaptureDevice method depending upon the type of driver in use): this recording session will not produce any output (ENCODING_FORMAT_NOFILE is just available for this purpose) and will only update the visual feedbacks each 15 ms; at the same time, if you have set a VU-Meter, you will also receive the VUMeterValueChange event which reports in real time the peak volume, allowing to detect when a certain threshold is crossed.

- when you really need to start a real recording session, after having detected the needed level through the event VUMeterValueChange mentioned above, stop the current one through the Stop method.

- set the EncodeFormats.ForRecording property to the format you need to produce in output, for example to ENCODING_FORMAT_WAV for WAV format or ENCODING_FORMAT_MP3 for MP3 format

- start the real recording session through a new call to the recording start method (StartFromDirectSoundDevice or StartFromAsioDevice or  StartFromWasapiCaptureDevice method).

As a second alternative, you could also use the embedded "Sound Activation System" which is described inside the tutorial named "How the Sound Activation System works" available inside the documentation:
http://www.multimediasoft.com/asrecnet/help/asrecnet_000021.htm

Kind regards

Severino Delaurenti
Logged