-
-
Notifications
You must be signed in to change notification settings - Fork 309
MP3 time measurement function #2193
-
Hi @pschatzmann.
I don ́t achieve to measure time of the MP3 playing file with PLAYER. Could you help me? The value always is zero.
Thanks in advance.
File* pFile = nullptr;
AudioSourceIdxSDMMC source("/","mp3",true);
...
pFile = (File*)source.selectStream("/test.mp3");
...
MP3DecoderHelix decoderMP3;
MetaDataFilterDecoder metadatafilter(decoderMP3);
MeasuringStream measureMP3(decoderMP3);
...
measureMP3.begin();
decoderMP3.begin();
player.setDecoder(metadatafilter);
player.begin();
...
while (playing)
{
sMP3_begin = measureMP3.estimatedTotalTimeFor(pFile->size());
Serial.println(sMP3_begin);
player.copy();
}
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
pschatzmann
Oct 10, 2025
You don't write any data to MeasuringStream!
You can use the setCallbackOnWrite() from the StreamCopy in the player, to feed it with data
Replies: 1 comment 1 reply
-
You don't write any data to MeasuringStream!
You can use the setCallbackOnWrite() from the StreamCopy in the player, to feed it with data
Beta Was this translation helpful? Give feedback.
All reactions
1 reply
-
Ok. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions
Answer selected by
pschatzmann
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment