Open ventureg opened 3 weeks ago
The API to get current play time is esp_audio_time_get
As shown in the code snippet, esp_audio_time_get is used, unfortunately it doesn't work on esp32s3
Is it possible to share your code, so we can check or reproduce it? For esp_audio
is pure softwre related code, it won't change the behavior when change to different board.
Please see the attached source code, I changed the suffix to png, actually it is a C file.
This project sets up a web server, tries to decode music files which are stored in spiff, and send the decoded PCM stream through websocket to web client.
This file is mainly copied from cli folder. High level API ESP AUDIO is used to play the music. And a raw stream servers as the last audio element in pipeline. The pipeline looks like: spiffs->mp3 decoder -> ReSample filter -> raw stream.
A dedicated task mp3_player_task is used to sink PCM data from the ending raw stream, and send it through web socket protocol.
Regularly function music_info is called to print the current time info.
Seems same as cli, I tested with cli after play, can use getpos to get current position correctly. You can compare your code with the cli realization
Environment
Problem Description
esp_audio_time_get doesn't return the correct current time, while I was hearing music.
esp_audio_info_get(player, &info); can not return the correct time ethier.
Expected Behavior
Actual Behavior
Steps to Reproduce
// If possible, attach a picture of your setup/wiring here.
Code to Reproduce This Issue
// If your code is longer than 30 lines, GIST is preferred.
Debug Logs
current_time_position.txt