Audio | Create Speech | return file bytes (Uint8List) for work on web and improve speed
Opened this issue · 0 comments
Currently, the createSpeech function returns a File object. This implementation is not optimal for web environments and can be improved in terms of performance. It would be beneficial to add an option to return a Uint8List from the createSpeech function.
Proposed Change
Add an option to the createSpeech function to return the result as a Uint8List instead of a File. This can be achieved by adding a parameter to specify the desired return type and adjusting the implementation accordingly.
Benefits
Improved performance for web environments by returning Uint8List directly.
Enhanced flexibility for developers to choose the appropriate return type based on their needs.
Additional Context
This change will help developers who are building web applications using the dart_openai package to handle speech synthesis results more efficiently.
Thank you for considering this feature request. Your efforts in maintaining and improving this package are greatly appreciated.