sound_record_save¶
Overview¶
The sound_record_save application records audio for a specified duration and saves it as a .wav file. Users can customize the duration and volume using command-line arguments.
Execution¶
The application can be executed with the following command:
python3 sound_record_save/ --auto-run
Users can also customize the duration and volume with the following optional flags:
-d, –duration: Set the duration of the recording in seconds (default is 5 seconds).
-v, –volume: Set the volume level for the recording (default is 100).
Example 1 (default duration and volume):
python3 sound_record_save/ --auto-run
Example 2 (custom duration and volume):
python3 sound_record_save/ --auto-run -d 10.0 -v 50
Inputs¶
-d, –duration: Duration for which the audio is recorded (in seconds). Default is 5.0 seconds.
-v, –volume: Volume level for the recording (0-100). Default is 100.
Outputs¶
The application logs the recording duration and the file path where the recording is saved.
The recorded audio is stored in /robot/generic_persistent_data/new_sounds/record_example.wav.
Behavior¶
The application starts automatically and records audio for the specified duration.
The recorded audio is saved as a .wav file.
The app finishes once the recording is successfully saved.
Example Output¶
# python3 sound_record_save/ --auto-run
[INFO] [timestamp] [pyraya.sound_record_save]: Auto running the app
[WARNING] [timestamp] [pyraya.sound_record_save]: Recording for 5.0 seconds in the file /robot/generic_persistent_data/new_sounds/record_example.wav...
[WARNING] [timestamp] [pyraya.sound_record_save]: Record Finish
[INFO] [timestamp] [pyraya.sound_record_save]: App finished