Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1659,7 +1659,8 @@ def generate_filename(prompt, file_type):
|
|
| 1659 |
|
| 1660 |
# 15. Audio recorder to Wav file
|
| 1661 |
def save_and_play_audio(audio_recorder):
|
| 1662 |
-
|
|
|
|
| 1663 |
if audio_bytes:
|
| 1664 |
filename = generate_filename("Recording", "wav")
|
| 1665 |
with open(filename, 'wb') as f:
|
|
|
|
| 1659 |
|
| 1660 |
# 15. Audio recorder to Wav file
|
| 1661 |
def save_and_play_audio(audio_recorder):
|
| 1662 |
+
unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
|
| 1663 |
+
audio_bytes = audio_recorder(key=unique_key)
|
| 1664 |
if audio_bytes:
|
| 1665 |
filename = generate_filename("Recording", "wav")
|
| 1666 |
with open(filename, 'wb') as f:
|