-
Notifications
You must be signed in to change notification settings - Fork 10
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
How to use an existing buffer #22
Comments
Hi lidense.
Not that easy I think. This library is intended purely as a (internet) stream client. |
If that is all your app is doing then you could maybe use just the VS1053 library and use the It says that the function blocks, but that is only true if you dont use This library uses While If you dont mind blocking use it to send the whole buffer in one go:
|
OK thanks for your answer, I will try.
Regards
Dave
…----- Mail original -----
De: "Cellie" ***@***.***>
À: "CelliesProjects/ESP32_VS1053_Stream" ***@***.***>
Cc: "lidense" ***@***.***>, "Author" ***@***.***>
Envoyé: Jeudi 14 Décembre 2023 16:24:57
Objet: Re: [CelliesProjects/ESP32_VS1053_Stream] How to use an existing buffer (Issue #22)
If that is all your app is doing then you could maybe use just the VS1053 library and use the
VS1053 playChunk() function.
It says that the function blocks, but that is only true if you dont use data_request() as a good to go signal.
This library uses playChunk() exactly in that way.
While data_request() is true, send 32 bytes until data is gone.
https://github.com/CelliesProjects/ESP32_VS1053_Stream/blob/master/src/ESP32_VS1053_Stream.cpp#L584-L596
If you dont mind blocking use it to send the whole buffer:
void playChunk(uint8_t *data, size_t len);
—
Reply to this email directly, view it on GitHub , or unsubscribe .
You are receiving this because you authored the thread. Message ID: <CelliesProjects/ESP32_VS1053_Stream/issues/22/1856052665 @ github . com>
|
Hi, I have used your app to listen to some radios and works great. Now I have developed a small app that provides a buffer in a loop with some aac audio data in chunks of about 1600 bytes coming from an decoded HLS stream. The buffer has this format: uint8 * data.
I can play the data using Adafruit VS1053 library with this code
if(vs_player.readyForData())
vs_player.playData(data,read);
but the sound is hashed and sometimes some bits are skipped.
I thought that using a circular buffer like esp32 Stream vs1053 might be better but I don't see how to feed the data to the stream.
I see that the main function stream.connectTohost is used to create a stream from a website, how can I instead feed by data buffer to the stream and get it played from vs1053?
Thanks for your help.
The text was updated successfully, but these errors were encountered: