RageAgainstThePixel / ElevenLabs-DotNet

A Non-Official ElevenLabs RESTful API Client for dotnet
https://elevenlabs.io/?from=partnerbrown9849
MIT License
59 stars 19 forks source link

Customize the file name and locations of saved audio clips #21

Closed rmangino closed 1 year ago

rmangino commented 1 year ago

If I call TextToSpeechEndpoint() like: var clipPath = await _elevenlabs_client.TextToSpeechEndpoint.TextToSpeechAsync(text, voice, defaultVoiceSettings, null, @"C:\temp");

The audio file is actually saved in: C:\temp\ElevenLabs\TextToSpeech\Rachel\x.mp3

Is there a way to specify a save directory and have the api actually save it in that location?

StephenHodgson commented 1 year ago

the name of the file is directly tied to their backend and is used to track the audio file in the history tab of the dashboard. I'll look into making it more editable in the future.

rmangino commented 1 year ago

Thanks @StephenHodgson.

I generally use ElevenLab's Python package to generate the audio data directly which allows me to save it where ever I want, in different formats, etc. Here's a simplified example. I was hoping it would be a similar process using your package.

from elevenlabs import generate, save

raw_audio_data = generate(text=text, voice=voice)
save(raw_audio_data , r "C:\temp\temp.wav")
    ...