Created
July 9, 2023 22:06
-
-
Save EnkrateiaLucca/7500979bdf7b5577c1b1442e172bd604 to your computer and use it in GitHub Desktop.
record audio using arecord cli tool from within Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import time | |
def record_audio(): | |
audio_file_path = "audio_output.wav" | |
command = 'arecord -f cd -r 16000 ' + audio_file_path | |
subprocess.run(command, shell=True) | |
if __name__ == "__main__": | |
record_audio() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment