-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
outframes always = 0 with op_open_memory ? #30
Comments
Hello. Some more explanation: ===> The code (in Pascal):
The result: (Part of) data of memory Buffer_byte: OggS��s��T=����OpusHead����OggS�s����;����OpusTags�Encoded with GStreamer Opusenc��ALBUM=Summer 2016 Fre;D |
My first thought is that your buffer size of 4096 seems kind of small... with op_open_memory you're expected to give it the whole file. |
Hello and thanks to answer.
Ha, but for internet streaming, only a buffer will be given. IMO, it seems that Buffer_byte entered in op_open_memory :
That Buffer_byte is not used in HandleOP:
Thanks. Fre;D |
Ooops, wait, I try just now with buffer size of 32768 and... => Outframes = 960 => part of Buffer_float :
So, yes, there is some movement there ;-) It is on the good way. But why only 960 frames for buffer-in of 32768 bytes (maybe it is normal ?) ? There is not yet sound, there is a arithmetic error with that buffer-out. But there is great progress. Of course, any comment is highly welcome. @tdaede : many thanks, now I am full of hope to do Opus-web-streaming work for the Pascal community. Fre;D |
Each call to |
Hello rillian. Yep, yep, yep, I get (bad) sound but it will work, sure. op_read_float() works like charm with op_open_file. It will work also with op_open_memory. OK, great, I begin to understand better how Opus work, now time to tune it. Write you later with a perfect sound from a Opus-web_streamed file. Fre;D |
Re-hello. What is the ratio between ASize and length of BufferURL here ? :
(if ASize = 100, length of BufferURL ⁼ ?) And here, if ASize = 100, length of BufferFloat = ?, BSize = ?
Many thanks. Fre;D |
See documentation here: https://opus-codec.org/docs/opusfile_api-0.5/group__stream__open__close.html#gaffc5769a1e5977f186f77a1fb08cb248 It's the size of the file in bytes. It doesn't directly correlate with op_read_float, as the bitrate of the file may change. If you want to do network streaming, you might want op_open_callbacks instead, which will call your application whenever you do an op_read_float but more input data is needed. Don't know how callbacks work with Pascal/Delphi, though. Also note that there's op_open_url, which will open and play from a HTTP stream for you. |
Hello. I did try to use op_open_url but without success. Even adding methods for libopusurl.so (did not find h header with this). Also I prefer use my own code for streaming and have access to the pipe. For op_open_callbacks, I try also but without luck, I will re-try. Thanks for doc but I do not see the ratio between between ASize and length of BufferURL in
Thanks. Fre;D |
Hello. Fixed ! The main problem was a ajustement of buffer size. Perfect sound from https Opus file. Many thanks. Fre;D |
Glad you got it working! |
Hello and congrat for that wonderful project.
I have done a translation of the C header into pascal:
https://github.com/fredvs/uos/blob/master/src/uos_opusfile.pas
op_open_file() is working like charm with op_read().
But with op_open_memory() I have problem: op_read() gives always 0 as result.
Why ?
Thanks.
Fre;D
Using op_open_file()
HandleOP := op_open_memory(BufferURL[0],PipeBufferSize, Err);
The text was updated successfully, but these errors were encountered: