using seekto() with mediaplayer

All your problems with Audio, Video and Images.

using seekto() with mediaplayer

Postby willis127 » Mon Nov 23, 2009 3:50 pm

I want to play certain portions of an mp3 for different area's. This will enable me to keep everything on one track and just enable me to play the portion of the mp3 I need. What I'm wondering is how to end at a certain point ?
Do I use the getCurrentPosition() method and determine where I want it to end and end it then with a for loop ?
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. MediaPlayer mp = MediaPlayer.create(MainActivity.this, R.raw.my_file);
  3.  
  4. mp.seekto(Some_INT);
  5.  
  6. mp.start();
  7.  
  8.  
  9.  
  10. for(x = Some_INT + 2;x == mp.getCurrentPosition();;)
  11.  
  12. mp.stop();
  13.  
  14.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


I just typed that up real quick to get this question out there. I have no idea if it will compile or not. Just wondering about the overall problem, not the syntax.
willis127
Freshman
Freshman
 
Posts: 9
Joined: Wed Nov 11, 2009 8:03 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 12 guests