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…
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|local|webrtc]
The recorded audio will be saved to recorded_audio.wav in the current directory.
Source and license
Source: Reachy Mini documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.