-1

I am making Android MP3 player app using AudioTrack. I must not use MediaPlayer in any case, and I use 16bit mono channel and 44100Hz. I heard that seekTo() method can be implemented using RandomAccessFile class But I don't know that well in detail. Please Help me.

seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
    ...
}
Riddhi Shah
  • 3,092
  • 5
  • 36
  • 56
주영준
  • 29
  • 1
  • 1
  • 3

1 Answers1

0

I hope it's not too late, but I can give you a few hints. For playing the audio track you will need to use MediaExtractor (https://developer.android.com/reference/android/media/MediaExtractor) When you play the track you can get the sample time using extractor.getSampleTime(), and then just send the progress to the seekBar: seekBar.setProgress((int) extractor.getSampleTime() / 1000);

Alexandru
  • 98
  • 8