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)
- Initialize `Client` with custom HTTP client, config, and backoff HOT 3
- Usage of std::thread::sleep inside async function in assistants example HOT 1
- Add retry on 504 Gateway Time-out and "connection closed before message completed" HOT 5
- Missing fields in `CreateTranscriptionResponse` HOT 2
- Supporting streams when running assistants HOT 3
- Set OPENAI_API_BASE to environment variable HOT 1
- Open
- Deserialize error when retrieve content HOT 2
- Failing to deserialize API response when translating audio with SRT output HOT 5
- &chat_choice.delta.function_call in the function-call-stream example has been deprecated HOT 2
- How to call async function through function-call HOT 2
- The type of messages in deserialized CreateChatCompletionRequest are all SystemMessage HOT 5
- γhelpγCould you please give me an example of defining multiple functions? HOT 4
- assistants header HOT 1
- Spec sync May 2024
- Running the `assistants` example results in Error HOT 4
- Wrong type of function tools in Assistant
- Failing to deserialize `VectorStoreFileObject` HOT 4
- CreateChatCompletionRequest.max_tokens should be u32 HOT 1
- Error when using assistant 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.