Audio File player

Status
Not open for further replies.
Hm... why are the reprogramming pops a problem for a ready project? There will be no reprogramms.. ???
*help* :)
 
Hm... why are the reprogramming pops a problem for a ready project? There will be no reprogramms.. ???
*help* :)


Haha - yes Frank I see your point.
Although, to be fair, I did say "almost there".

I'm not as proficient as most of the people on this forum - so the last few steps may still take me a while I'm afraid :)

So - Apart from it being really annoying - I 'll like to protect my Monitors, not sure this is good for them in teh long term.

BTW - By placing a long delay at various stages of my code, I've managed to pin point what triggers the pop.
Its "sgtl5000_1.enable();" in teh void Setup().
 
Having to use this:

Code:
uint32_t positionMillis();
 lcd.print(playMp31.positionMillis()/[B][U]2000000[/U][/B]);
to get it to display anything even near the actual position in seconds.

Anything obvious pls?

Also - playMp31.lengthMillis() appears to output the same as position.
 
LengthMillis does not work good.
Thats because of the mp3-data. There is no way to determine the length without reading the whole file, esp. if it has not a constant bitrate ("CBR" vs "VBR")
So.. don't use length. Long term, i will try to fix that... someday..

positionMillis: thanks for the feedback. I try to fix that in the next days. I never used it...:)

P.s. try looking to the display of cheaper mp3 players. They all have problems with the length in seconds. The better ones display a good approximation.. When you look closer, youll see that some of them try to adjust the length-display during the playing.
 
Last edited:
Hi - still got teh click - but apart from that project progressing nicely.

Just wondering - has anyone manged to use teh bounce.h library for detecting double presses or long presses.?

Any pointers would be much appreciated pls.
 
Just wondering - has anyone manged to use teh bounce.h library for detecting double presses or long presses.?

Any pointers would be much appreciated pls.

To do that, you'd probably have to build up some extra code in your program. Using an elapsedMillis variable would probably be the simplest way. You'd set it to zero when button.fallingEdge() returns true.

To detect a "long" press, you'd probably also call button.read(). If the button reads LOW, and if the elapsedMillis variable is greater than whatever time you consider long, you'd do whatever action you want. You'd probably also set a boolean to remember you already did the thing and shouldn't repeat it over and over. Obviously you'd clear that boolean when resetting the elaspedMillis var back to zero.

To detect double press, perhaps when button.fallingEdge() is true, before you reset the elapsedMillis variable to zero, read it to check the amount of time elapsed since the prior falling edge. Again, you might have to add boolean flags to remember you've responded to the double press, so you don't respond twice if the user makes a quick triple press. Or maybe you do want that?

Hopefully this gives you some ideas to build the behavior you want...
 
Status
Not open for further replies.
Back
Top