Seeking position in an MP3 file? #1899
-
Problem DescriptionApologies if the information is available somewhere here, but I cannot find anything... I was looking at the player-sd-audiokit example and the underlying AudioSourcesSTD.h and I am still not sure: is it possible to seek a specific position in an MP3 file or to rewind/fast forward the file a specific number of seconds? Device DescriptionESP32 Audio Kit v.2.2 A436 Sketchplayer-sd-audiokit.ino Other Steps to ReproduceNo response What is your development environmentNo response I have checked existing issues, discussions and online documentation
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Please follow the instructions given in the Readme and don't file your questions as errors! The first question is not really related to my framework: of cause you can change the actual file position with the corresponding file api using seek() and position(). For the second question I refer to my answer above: you just need to translate the seconds to bytes. You can determine the bytesPerSecond() with the help of the MeasuringStream. Please note that with the AudioPlayer this class can't be used in a chain, so you need to update the processed bytes (with setProcessedBytes()) after calling copy(); ps. there is no such thing as a AudioSourcesSTD |
Beta Was this translation helpful? Give feedback.
-
Apologies for the misposting! I will look into the methods you describe. |
Beta Was this translation helpful? Give feedback.
Please follow the instructions given in the Readme and don't file your questions as errors!
The first question is not really related to my framework: of cause you can change the actual file position with the corresponding file api using seek() and position().
For the second question I refer to my answer above: you just need to translate the seconds to bytes. You can determine the bytesPerSecond() with the help of the MeasuringStream. Please note that with the AudioPlayer this class can't be used in a chain, so you need to update the processed bytes (with setProcessedBytes()) after calling copy();
ps. there is no such thing as a AudioSourcesSTD