Sound Recording
This example demonstrates how to record audio from Reachy Mini's microphone array and save it to a WAV file. The script records for 5 seconds and saves the audio to recorded_audio.wav.
How it works:
- Starts audio recording using
start_recording() - Continuously retrieves audio samples using
get_audio_sample() - Collects samples until the desired duration is reached
- Stops recording and concatenates all samples
- Saves the audio data to a WAV file using
soundfile
Features:
- Configurable recording duration (default: 5 seconds)
- Automatic sample rate detection
- Timeout protection to prevent infinite loops
- Support for different media backends
Usage:
python sound_record.py --backend [default_no_video|gstreamer_no_video|webrtc]
The recorded audio will be saved to recorded_audio.wav in the current directory.
See the full example at: sound_record.py