getting saved file name and saving it

This commit is contained in:
talksik
2023-04-28 15:35:17 -07:00
parent e45be75f9b
commit ef0d71930e
2 changed files with 21 additions and 17 deletions
+5 -10
View File
@@ -1,16 +1,10 @@
# this program will record audio while the button is pressed
# and then will transcibe it by hitting our api
# and then will transcribe it by hitting our api
import RPi.GPIO as GPIO
# importing sys
import sys
# adding Folder_2/subfolder to the system path
sys.path.insert(0, '/home/talksik/rpi-random-projects/audio')
import audio
import audio.audio
from simple_recorder.apa102 import apa102
BUTTON = 17
@@ -41,7 +35,8 @@ while True:
if state:
if audioInstance.isRecording():
turnOffLED()
audioInstance.stopRecord()
savedFileName = audioInstance.stopRecord(save=True, play=False)
print("saved file: " + savedFileName)
else:
if not audioInstance.isRecording():
turnOnLED()