English 中文(简体)
借助音频和海底进展的阻断
原标题:android progress bar movement with audio

How can I make progress bar or progress dialog movement with audio in android

I am trying to design an audio player. I need help regarding the progress bar. I want the status of progress bar to change as the audio progresses. I want progress bar to pause as I press Pause button and start again as I press start button. Please help... Thanks

最佳回答

步骤1:

  • Get audio duration with MediaPlayer.getDuration()

步骤2:

  • Set ProgressBar progress max. value to value from step 1

步骤3

  • Update progress bar periodically from MediaPlayer.getCurrentPosition(), while media playing using Handler. Check here

成员;

  • 停止定期更新第3步的休息和停工

  • 如果要增加进步商品,请使用媒体宣传员。 To(int msec) 方法,其中msec正在寻求Bar.getProgress(),使用Ca.OnSeek BarChangedListener

Good Luck!

问题回答

暂无回答




相关问题
Playing a Sound With Monotouch

No matter what I try (build -> content, NSUrl, filename) I get a null exception : file not found when I try to play a .caf sound file in monotouch. //var path = NSBundle.MainBundle.PathForResource("...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

Play sound in iPhone web app with Javascript?

I m currently creating an iPhone web application for piano chords, and I wanted to add an option that would let the user press a Play button and play the selected chord. However, I m not sure how to ...

热门标签