Spaces:
Running
on
Zero
Running
on
Zero
Update elevenlabs_utils.py
Browse files- elevenlabs_utils.py +5 -4
elevenlabs_utils.py
CHANGED
@@ -77,7 +77,8 @@ class ElevenLabsPipeline:
|
|
77 |
self.client = ElevenLabs(
|
78 |
api_key=eleven_labs_api_key, # Defaults to ELEVEN_API_KEY
|
79 |
)
|
80 |
-
os.makedirs("./tmp", exist_ok=True)
|
|
|
81 |
|
82 |
def clone_voice(self, audio, name, description=None):
|
83 |
response = self.client.voices.get_all()
|
@@ -167,10 +168,10 @@ class ElevenLabsPipeline:
|
|
167 |
# Concatenate the segments
|
168 |
combined_segment = mute_before + audio_segment + mute_after
|
169 |
|
170 |
-
tmp_file = generate_random_filename("./tmp", "mp3")
|
|
|
171 |
|
172 |
# Export the combined audio to the specified file
|
173 |
combined_segment.export(tmp_file, format="mp3", bitrate="128k")
|
174 |
|
175 |
-
|
176 |
-
return combined_segment
|
|
|
77 |
self.client = ElevenLabs(
|
78 |
api_key=eleven_labs_api_key, # Defaults to ELEVEN_API_KEY
|
79 |
)
|
80 |
+
#os.makedirs("./tmp", exist_ok=True)
|
81 |
+
os.makedirs("/tmp/elevenlabs", exist_ok=True)
|
82 |
|
83 |
def clone_voice(self, audio, name, description=None):
|
84 |
response = self.client.voices.get_all()
|
|
|
168 |
# Concatenate the segments
|
169 |
combined_segment = mute_before + audio_segment + mute_after
|
170 |
|
171 |
+
#tmp_file = generate_random_filename("./tmp", "mp3")
|
172 |
+
tmp_file = generate_random_filename("/tmp/elevenlabs", "mp3")
|
173 |
|
174 |
# Export the combined audio to the specified file
|
175 |
combined_segment.export(tmp_file, format="mp3", bitrate="128k")
|
176 |
|
177 |
+
return tmp_file
|
|