How set duration of the ringtone's play
问题 My app play ringtone. My code: RingtoneManager.getRingtone( context, RingtoneManager.getDefaultUri( RingtoneManager.TYPE_NOTIFICATION)).play(); Ringtone play very well. But if ringtone is long I need cut the first N milliseconds from it. How get full duration of this ringtone? How set maximum duration in milliseconds of this ringtone? 回答1: Just put the RingTone in mediaPlayer for eg Mediaplayer mp =new MediaPlayer(); uri = RingtoneManager.getDefaultUri( RingtoneManager.TYPE_NOTIFICATION)) mp