10

I need to record sounds emanating from mechanical equipment. These sounds occur randomly every few hours and only last approximately 1-3 seconds.

To accomplish this task, I need an audio recorder that is constantly running, but that only records when audio is present. There are many audio recorders that are "voice activated", but I have not found any that will work because by the time they activate, the sounds I am trying to capture have concluded.

To accomplish this, I need an app that continually records, but only keeps audio from "sound activation minus x seconds". It is no problem if 'x' is fixed.

Requirements

  1. Android KitKat compatible
  2. Can run for at least 4 hours unattended

Preferences (none required)

  1. Gratis (free of charge)
  2. Low battery use during operation
  3. Can run for at least 12 hours (or longer) unattended

Update: Congrats! I have awarded the bounty to @4mohit for his/her answer. I'm still performing testing to see if it works reliably for my task. Thanks also to Steve Barnes for his creative answer.

Since I'm still in the testing phase, I am open to more answers. I will post more updates as testing progresses.

3 Answers 3

7
+50

If you are looking for a voice recorder that can record audio continuously and skips the silence and can run for 4 hours unattended, then I think you should look into Smart Voice Recorder. It meets your requirements of,

  • Being gratis
  • Can run for 12 hours
  • Is able to record in background even when display is off (make sure you have enough disk space on your device)
  • Can record from 8kHz (phone quality) to 44.1 kHz (CD quality)

From the description in the Google Play store:

Smart Voice Recorder

Screenshot of Smart Voice Recorder, currently recording

Smart Voice Recorder designed for high quality long-time sound recording with skipping relative silence on-the-fly. For example, you can use it for record night sleep talks (or snoring:)), business meetings, a regular day of your babysitter, how you sing or play the guitar and so on. It's fantastic! And you may use it as regular voice recorder with simple and nice user interface. Give it a try! :)

NOTE: This app is not call recorder. May not work properly on some handsets. User interface not optimized for tablets yet. Recordings in this format cannot be sent via text/sms/mms. Please feel free to send me feedback via email if you have any.

Features:

  • automatic and manual sensitivity control for Skip silence mode (Beta)
  • live audio spectrum analyzer
  • wave/pcm encoding with adjustable sample rate (8-44 kHz)
  • recording in background (even when display is off)
  • microphone gain calibration tool
  • save/pause/resume/cancel recording process control
  • storage and directory change (default: sdcard/SmartVoiceRecorder)
  • remaining recording time showed on home screen, limited only by available space on your storage (and tech. limit 2GB per file)
  • easy to use recordings list
  • send/share a recording via email, whatsapp, dropbox, etc.
  • set a recording as an ringtone, alarm or notification in one click

Permissions that this app needs are:

  • internet access (for displaying ads and some stats collection)
  • write to external storage (to store recordings)
  • record audio
  • wake lock (for prevent device from sleeping)
  • write settings (for ability to set default system ringtone/notification/alarm)
  • billing (for in-app option to turn off ads)
4
  • 1
    Thank you for the recommendation. Unfortunately almost all of these voice recorders will miss the first 250ms to 1s of the recording and thus will not work for this application. This is because they don't actually start recording until after they have detected a sufficient amount of audio. Do you know if this particular app will work for the stated purpose? Commented Oct 1, 2015 at 21:48
  • Yes it sure can work it's not voice activated so it can record a sound for a long time
    – Mohit Garg
    Commented Oct 2, 2015 at 4:40
  • And it can remove all the empty space from the recording.And has a live audio spectrum analyzer too
    – Mohit Garg
    Commented Oct 2, 2015 at 5:23
  • 1
    Congrats! I have awarded the bounty to @4mohit for this answer. Commented Oct 6, 2015 at 17:25
3

If you can use a laptop rather than a mobile then you could do this with python + pyaudio. The Record sample looks like:

"""PyAudio example: Record a few seconds of audio and save to a WAVE file."""

import pyaudio
import wave

CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "output.wav"

p = pyaudio.PyAudio()

stream = p.open(format=FORMAT,
                channels=CHANNELS,
                rate=RATE,
                input=True,
                frames_per_buffer=CHUNK)

print("* recording")

frames = []

for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
    data = stream.read(CHUNK)
    frames.append(data)

print("* done recording")

stream.stop_stream()
stream.close()
p.terminate()

wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb')
wf.setnchannels(CHANNELS)
wf.setsampwidth(p.get_sample_size(FORMAT))
wf.setframerate(RATE)
wf.writeframes(b''.join(frames))
wf.close()

But you could quite easily modify this to check if the sound levels have passed a given threshold and if it has been exceeded to record the current set of frames to a file named for the time & date.

Determine if the sound level has exceeded a given threshold should be as simple as:

loudest = max([max(chunk) for chunk in frames])
if loudest > THRESHOLD:
   # Save your frame

but I would consider using a dqueue to store your frame and once the length of the frame is reached, pop a chunk from one end before pushing to the other, if you are recording save the chunk, otherwise pop and discard. You could then when getting each chunk just check the max of that chunk and if it is over the threashold set a counter to the size of the frame plus the desired overrun and if there is no current open wave file, open one with the name based on the time, if there isn't one decrement the counter if it is over 0 and write to the file, when it reaches 0 close the file.

  • Free
  • Android I don't think pyaudio has been ported to android so no
  • The size of your frame will determine the amount of time before the sound were recorded. You could also overrun the end of the sounds by a selected time.
  • Time stamps in the file names would let you see when the sounds were.

Python can also be used to plot and analyse the resulting files as in this blog.

3
  • Very nice. Is this a readily available script or did you just whip this up yourself?
    – voices
    Commented Oct 3, 2015 at 6:29
  • The example script is readily available - you need to tweak a bit to get what you need but you should be able to do it quite readily. Commented Oct 3, 2015 at 8:45
  • You might also be interested in zulko.github.io/blog/2014/07/04/… which uses similar mechanisms to spot the important parts of football match videos. Commented Oct 3, 2015 at 18:34
0

just use Automatic Audio Recorder it have everything you're looking for including automatic record when there are some noise.

pic

1
  • 1
    That app hasn't been updated for over 2.5 years. Does it still work reliably on Kitkat (especially considering the SD card stuff)? Does it match all the other requirements, e.g. low battery consumption (how low, according to your experience/information)? What makes it recommendable (preferably by personal experience)? Please read our discussion on what makes an answer high quality and see if you can improve your post. Thanks!
    – Izzy
    Commented Oct 3, 2015 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.