English 中文(简体)
安德森发展公司在纽顿点击点击时使用多种声音文档。
原标题:Android Development play multiple sound files on button click

我正在利用以下手段在纽扣地上打上音响:

        final MediaPlayer buttonSound = MediaPlayer.create(menu.this, R.raw.button_sound);  
info.setOnClickListener(new View.OnClickListener() {
        
        public void onClick(View v) {
            // TODO Auto-generated method stub
            buttonSound.start();

Is it possible to add code that allows the button to play a sound, then wait for a second, and then play another sound file? What I am really asking is how I can play multiple CONSECUTIVE sound files! I need them to be played one at a time with a pause! I am working on a personal reading app for my son and would be so grateful for advice/help.

最佳回答
buttonSound.setOnCompletionListener(new OnCompletionListener() {
  @Override
  public void onCompletion(MediaPlayer mp) {
    // play another sound here
  }
});
问题回答

使用一个声音,先装上声音,使用手动器。 员额 推迟对纽芬兰的点击进行处理。





相关问题
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 ...

热门标签