Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
What I want to do is very clear, just play sound and pause it. The problem is that I can't pause the music. When I click the pause button music keeps playing .I have been working on for 2 hours. I can't find the mistake; what am I doing wrong?
Edit:I am posting all code
Please show us a short bit of code where you are trying to pause the music. That is called an (link→)SSCCE.
Another link which tells you the same:- here.
I am sorry.I know I shouldnt post all the code . But I cant find any solution for 2 days and .I thouht if I post all the code It might be helpfull someone who wants to test it .
I don't know the API but there is something odd about starting the player with the audio stream and stopping it with the file input stream. Shouldn't you be calling stop() and passing in the audio stream and not the file input stream.
Yes my friend I have also realized that .But I havent changed until you point out. Because this was a small part of project that I found on the net .SoI thouht I must be like this way .But you are absolutely right.Thank you so muchh
I was playing around with the JLayer library and I had to tweak it like this to get it to resume at the same place. It seems that event.getFrame() returns milliseconds and not frames. A "typical" MP3 has about 27ms per frame. If you could get access to the MP3's metadata you could verify this by looking at the sampling rate and samples per frame. Also, getFrame() does not return the absolute position in the MP3 but the position relative to the start point, which is different if you've already done a pause-resume, hence the increment (+=).