• Post Reply Bookmark Topic Watch Topic
  • New Topic

My Midiplayer isn't looping  RSS feed

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can only figure it has something to do with the methods I'm using. The music would play, then when it reaches the end of the track, the looping method picks that up.

But for some reason, it executes both the if and else blocks.

In other words, the music plays, then when its supposed to loop again, it stops and terminates.


Here are the codes. This is the client class where the looping fails.




And this is the utility class.

 
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the utility class where you control the looping, you simply call sequence.start(). The start method API says this:

Since the playback has just completed, the current position would be at the end of your MIDI sequence. You need to re-set the sequence. I think the best way to do that is to use:

But I wonder why you don't use the MIDI Sequencer's inbuilt looping?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!