anasfik / openai

Dart/Flutter SDK for ChatGPT and all OpenAI APIs (GPT, Dall-e..)
https://pub.dev/packages/dart_openai
MIT License
591 stars 184 forks source link

TTS file length/metadata is faulty for AAC #170

Closed adigladi closed 7 months ago

adigladi commented 7 months ago

First of all, great job with this package, it's really easy to use!

I've found an issue with the audio files returned from the createSpeech method using responseFormat: OpenAIAudioSpeechResponseFormat.aac: the duration of the file seems to be incorrect. I noticed this when the Duration of the audio file did not match with the final progress value of playing the audio in the app. Playing the file in firefox shows the progress bar jumping to the end when the audio file stops about 5 seconds before the end and a similar thing happens in the OS X previewer.

However, this does not seem to happen for the OpenAIAudioSpeechResponseFormat.mp3 response type. I've tried using both 'tts-1-hd' and 'tts-1' with the same result.

See these example files:

TTS.zip

adigladi commented 7 months ago

Seems like this is an issue with OpenAI, closing this. Reference thread for others interested: https://community.openai.com/t/aac-files-have-wrong-duration/719744