B4J Question Play several audio files one after another with no pauses.

Discussion in 'B4J Questions' started by wdegler, Jul 19, 2015.

  1. wdegler

    wdegler Active Member Licensed User

    I need to play several audio files of various durations using MediaPlayer one after another with no gaps between and with no overlap. How can I do this?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Use a timer with an interval equals to the audio file duration.
     
  3. wdegler

    wdegler Active Member Licensed User

    Never mind. I figured it out. Instead of using a timer, I find that the event handler "Complete" does the job.
     
  4. wdegler

    wdegler Active Member Licensed User

    I just saw your reply Erel. I am not clear how to use "Duration". Does it tell me the duration of an audio file independently of playing it?
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Actually your solution is better. Use the Complete event.

    My suggestion was to check the interval after you initialize MediaPlayer and use a timer with an interval set to this player duration.
     
  6. wdegler

    wdegler Active Member Licensed User

    Thank you, Erel. Your responses cleared this up for me.
     
Loading...