Survey banner
The Dataiku Community is moving to a new home! We are temporary in read only mode: LEARN MORE

Saving an audio file to S3

Solved!
harsha_dataiku
Level 2
Saving an audio file to S3

Hi, I am trying to perform a Text-to-Speech conversion task, I am able to convert the text using the gTTS library in python, but when I am trying to save it to a S3 folder. I am getting an empty file. But saving it locally and playing in the notebook works. Let me know if there is a way to save audio files in S3. Thanks. Attaching the code for reference.

0 Kudos
1 Solution
Turribeach

Please use the code button to insert code snippets in your post (the </> icon in the toolbar, see sample below) so they can be easily copy/pasted. 

Your results are expected since this line:

Audio_Folder.upload_stream("welcome.mp3", myobj.save("welcome.mp3"))

expects a file like object which is not what myobj.save() method returns. Try with this approach:

https://stackoverflow.com/questions/51164040/gtts-direct-output

 

 

View solution in original post

0 Kudos
1 Reply
Turribeach

Please use the code button to insert code snippets in your post (the </> icon in the toolbar, see sample below) so they can be easily copy/pasted. 

Your results are expected since this line:

Audio_Folder.upload_stream("welcome.mp3", myobj.save("welcome.mp3"))

expects a file like object which is not what myobj.save() method returns. Try with this approach:

https://stackoverflow.com/questions/51164040/gtts-direct-output

 

 

0 Kudos