Comments (9)
Just FYI, this isn't about async-openai
lib but more about what is returned from OpenAI API.
I'm doing some further investigation, and it's quite strange.
It appears that the .flac
file returned by the OpenAI API lacks certain details like duration, which causes playback issues in QuickTime and DaVinci Resolve.
However, Chrome seems able to play it.
Also, if I take a .aac file and convert it to .flac using software like Isotope RX10, then it plays fine in QuickTime and DaVinci Resolve.
The openai flac file is also much smaller compared to a .flac file converted from .aac (89kb vs 163kb from the exported .flac file).
Anyway, just noting this down for the record. No action needed.
from async-openai.
Okay, apologies, this will be my last comment on this topic. (In case someone else encounters the same issue)
The workaround is to use ffmpeg to re-encode.
ffmpeg -i test-audio-from-openai.flac -c:a flac test-audio-fixed.flac
Since both input and output are lossless, and we do not change any parameters, there should be no loss in quality.
from async-openai.
😄 it's all good, thank you for making note for next person stumbling on similar problem.
Video sounds exciting, looking forward to it!
from async-openai.
In addition, if you'd like to, we can add link to video on README, it will be a good resource for fellow Rustaceans.
from async-openai.
That will be cool. I am busy right now, but I definitely want to do this sometime.
from async-openai.
Thank you for detailed description. I ran it to generate flac and it works for me.
I ran this on Ubuntu, what OS are you running? Does it play other .flac files?
I'm attaching the audio file that I got from output , does this play for you?
issue-161-flac.zip
from async-openai.
Interesting, I cannot play the file you sent me. I am on Mac M3.
But the weird thing, is when I do the same API call with TypeScript, i can play the flac file fine.
from async-openai.
I tried this on Mac M1. It appears that by default .flac is opened in QuickTime player but it cannot play it.
When I open same .flac file in VLC player it does work. Not sure what to make of it though.
from async-openai.
Oh, I'm so sorry, I think it is my mistake.
In TypeScript, while I thought I had the types correct, it turned out to be one of those corner cases. The issue was with the output format; it was saved with a .flac extension, but the default was actually .mp3 as the property format
was not a property, as it was response_format
. So, I mistakenly thought Quicktime and Davinci Resolve supported FLAC, but they were just playing the mp3 (under the .flac extension).
So, it's a Mac & Resolve issue.
My apologies for this confusion. I think we can close this ticket.
I will conduct further investigations, but at this point, I don't believe it's an issue with async-openai
.
Thank you. async-openai
has been working very well, and I am planning to make a video about it one of these days.
from async-openai.
Related Issues (20)
- Tokenizer support HOT 2
- Missing names in ChatCompletionRequest[User, System, Assistant]Message
- Example of multiple function calls HOT 2
- how to change base_url? HOT 2
- Auto Generation from OpenAPI spec HOT 2
- Add support for llama.cpp completions HOT 2
- impls.rs: AssistantTools HOT 3
- query for client files list seems to be missing HOT 1
- Why is there a \n\n prepended to the response? HOT 2
- Changing base url - Usage with open source LLM - Invalid status code: 404 Not Found HOT 3
- Stabilizing wasm target HOT 2
- Support text-to-speech (TTS) streaming functionality HOT 12
- Advanced error handling for OpenAI-like LLM APIs
- Test compilation failed HOT 2
- Support variable length embeddings HOT 3
- OpenAI transcriptions api language field is invalid ! HOT 1
- Embedding deserialization error when using encoding_format `EncodingFormat::Base64`
- Ollama AI Chat Completion Example / OpenAI Compatibility HOT 3
- Sync OpenAPI spec changes after 4th Jan 24 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async-openai.