Android Question Cannot clear canvas

Mark Read

Well-Known Member
Licensed User
Longtime User
I am using a modified version of the demo from steveIO5 to show the waveform of a playing mp3. I cannot get the canvas to clear, the waveform is always drawn on top of the old one. What am I doing wrong. Included is the full code without the mp3 file (added in line 37).
The code is for B4A 3.80 and using Media Player

I think it is probably something simple but its driving me crazy!

Thanks for any help
 

Attachments

  • visualizer.zip
    8.5 KB · Views: 215

Mark Read

Well-Known Member
Licensed User
Longtime User
ok. How to destroy it. Just to see, I moved the "Viz.DrawWaveFormStart" into the Wave_Capture sub. No go! The wave does not scroll and the mp3 breaks apart!
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
That was not a good idea. Had to hard reset my tablet! oops.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
No, because the when thread that the wav draw routine runs it will be continually initialized.
 
Last edited:
Upvote 0

stevel05

Expert
Licensed User
Longtime User
The two need to run totally separately.
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Where can I put the Viz.DrawWaveFormStart so that the wave starts without a button or is that not possible?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
You can put it straight after the MP.Play call in Activity_Create
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I have to go out shortly, if you get any problems, post a message and I'll look at it when I get back, or in the morning.
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Great, this is going to take some time to digest. Great work! I will try to include the WaveDraw class into my app AND get the gradient to work. If I get it to work, I will post it here to finish this thread.

Cheers.
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Steve, its working! (Jumping for joy). The touch to end the app gives an error but the gradient works thanks to you. Now I just need a few more panels with different displays, FFT etc.
 

Attachments

  • visualizer.zip
    10.7 KB · Views: 159
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Yes, Fft I've not looked at that. Hopefully someone will give us some direction there. Otherwise it's back to school I think.
 
Upvote 0
Top