Spaces:
Runtime error
Runtime error
gamingflexer
commited on
Commit
·
cd5296d
1
Parent(s):
6798380
Add directory creation for audio files
Browse files- src/app2.py +1 -0
src/app2.py
CHANGED
|
@@ -41,6 +41,7 @@ def sample_fun(voice_input, product_id, progress=gr.Progress()):
|
|
| 41 |
sample_rate,audio_data = voice_input
|
| 42 |
progress(0.1, desc="Collecting audio data")
|
| 43 |
# audio_data = audio_data.reshape(-1, 1)
|
|
|
|
| 44 |
audio_save_path = os.path.join(BASE_PATH,"audio",audio_path)
|
| 45 |
sf.write(audio_save_path, audio_data, sample_rate)
|
| 46 |
# print("Product ID:", product_id)
|
|
|
|
| 41 |
sample_rate,audio_data = voice_input
|
| 42 |
progress(0.1, desc="Collecting audio data")
|
| 43 |
# audio_data = audio_data.reshape(-1, 1)
|
| 44 |
+
os.makedirs(os.path.join(BASE_PATH,"audio"),exist_ok=True)
|
| 45 |
audio_save_path = os.path.join(BASE_PATH,"audio",audio_path)
|
| 46 |
sf.write(audio_save_path, audio_data, sample_rate)
|
| 47 |
# print("Product ID:", product_id)
|