betalgo / openai

OpenAI .NET sdk - Azure OpenAI, ChatGPT, Whisper, and DALL-E
https://betalgo.github.io/openai/
MIT License
2.85k stars 513 forks source link

Add Text To Speech (tts-1) feature #419

Closed belaszalontai closed 7 months ago

belaszalontai commented 8 months ago

Add Text To Speech feature based on the API ref: https://platform.openai.com/docs/api-reference/audio/createSpeech

belaszalontai commented 8 months ago

I am not 100% sure that the implementation of handling CreateSpeechResponse is proper. Please review. Can be tested in the playground too.

kayhantolga commented 7 months ago

Thanks for the PR, I will do a code review as soon as possible.

kayhantolga commented 7 months ago

@belaszalontai @szabe74 I made some updates, please have a look.

belaszalontai commented 7 months ago

Thnx to made it generic + introduced stream. This was what I wasn't shure about. From my side its reviewed and OK.

belaszalontai commented 7 months ago

@MartinKlepal I have downloaded your zipped mp3 files and listened. It looks fine. All sentence is spoken. Please try it with another mp3 player.

MartinKlepal commented 7 months ago

@MartinKlepal I have downloaded your zipped mp3 files and listened. It looks fine. All sentence is spoken. Please try it with another mp3 player.

you are absolutely right, I did not even think about it. I used the lates version of VLC medial Player, which never let me down before. Sorry for my earlier post, which I deleted already. And thanks you for your very good work on the betalgo openai