Have you ever needed to record high-quality audio only when there’s sound, and be able to control it remotely? Meet AudioRecorderWithHTTP—a flexible, Java-based audio recording application that listens for HTTP commands, making it perfect for hands-free, sound-triggered recording that’s easy to manage over a network.

Key Features

1. Sound-Activated Recording: The program automatically starts recording when it detects sound above a configurable threshold, ensuring that you capture only relevant audio. This is ideal for situations where you want to record intermittently without manually managing start/stop points.

2. Automatic Stop on Silence: The recorder will stop recording when it detects prolonged silence, based on a customizable timeout, so you can control when a recording session ends without intervention.

3. Remote Control via HTTP Server: The application starts an HTTP server that listens for various commands. You can configure the recorder’s settings, start and stop recordings, and check the recording status through simple HTTP requests.

4. Persistent Settings: All configuration changes are saved to a config.properties file, meaning your setup persists across program restarts.

Audio and Server Configuration

Sample Rate: The program defaults to 96,000 Hz for capturing high-quality audio.

Sample Size: Audio is recorded at 24-bit resolution, providing a high dynamic range that’s ideal for professional audio.

Channels: Stereo recording (2 channels) is supported for spatial audio capture.

Customizable HTTP Port: Use the -p option to specify a custom HTTP port if 8000 is unavailable or in use by other applications.

Changing the Server Port with -p

By default, AudioRecorderWithHTTP listens for HTTP commands on port 8000, but you can change this with the -p option when launching the program. For instance, running:

java -jar AudioRecorderWithHTTP.jar -p 8080

will start the HTTP server on port 8080 instead. The specified port number is stored in the config.properties file, so the application will remember your preference the next time it runs. This feature is helpful if you need to use specific ports or avoid conflicts with other services running on your machine.

HTTP Command Overview

The application provides several commands accessible via HTTP to manage settings and recording functions:

/help: Displays a list of available HTTP commands.

/setdevice: Allows you to specify the input device by name.

/setformat: Choose an audio format, supporting sample rates like 96,000 Hz, 48,000 Hz, and 44,100 Hz.

/setfile: Set the output file path for saved recordings.

/setthresholds: Adjust start and stop sound levels, as well as the timeout period for stopping on silence.

/start: Begin recording, which will wait for sound detection if the start threshold is not immediately met.

/stop: Stop the recording session instantly.

/status: Check the current recording status, including whether the recorder is active, waiting, or idle.

Getting Started

To start AudioRecorderWithHTTP, run it as follows:

java -jar AudioRecorderWithHTTP.jar

Or, to customize the port:

java -jar AudioRecorderWithHTTP.jar -p 8080

Once running, you can configure the recorder using HTTP commands.

Example Use Cases

AudioRecorderWithHTTP is perfect for:

1. Nature Sound Recording: Start and stop recording based on detected sound, filtering out long periods of silence.

2. Lecture and Meeting Recording: Place it in “waiting” mode to capture only relevant parts of a conversation, saving disk space and post-processing time.

3. Home Studio Setup: Integrate AudioRecorderWithHTTP into your studio workflow, controlling it from any device on your network for remote hands-free operation.

Sample HTTP Commands

Here’s how you can use HTTP requests to control the recorder:

# Set the input device to a specific microphone

curl -X POST -d “VB-AUDIO A” http://localhost:8000/setdevice

# Set the output file format to 48kHz, 24-bit, stereo

curl -X POST -d "48000-24-2" http://localhost:8000/setformat

# Specify the output file path

curl -X POST -d "my_recording.wav" http://localhost:8000/setfile

# Adjust start/stop thresholds and silence timeout

curl -X POST -d "startThresholdPercentage=3&stopThresholdPercentage=1&stopTimeoutMs=60000" http://localhost:8000/setthresholds

# Start recording

curl -X POST http://localhost:8000/start

# Check current recording status

curl http://localhost:8000/status

# Stop recording

curl -X POST http://localhost:8000/stop

Wrapping Up

AudioRecorderWithHTTP makes remote-controlled, sound-activated recording easier than ever. Whether you’re recording sounds in nature, capturing conversations in a meeting, or setting up a flexible home studio, this tool offers the control and configurability you need. With customizable audio settings, easy-to-use HTTP commands, and automatic recording management, you’ll always capture exactly what you need without excess noise.


Leave a Reply

Your email address will not be published. Required fields are marked *