Reputation: 5705
I am creating a Media Player app. Everything is working fine but I want to give option to increase playback speed, for eg. 1.5x
,2x
etc. I saw few Stack Overflow questions and they all suggested to use Sound Pool for this as Media Player doesn't support this thing. But from following link
Speed Control in Media Player and this Changing PlayBack Rate of Track
it is suggested that Sound Pool is only suitable for small file sizes for upto 1 MB and is also limited to increasing speed only to 2x and all those answers are about 6 years old. So are there any other alternatives available now.
EDIT: As Ian Lake suggested Using getPlayBackParams()
is an option to do so but is only available from API 23 but my app has to support at least API level 14.
Upvotes: -1
Views: 803
Reputation: 199795
Actually, MediaPlayer
does support playback rate changes via setPlaybackParams() and PlaybackParams#setSpeed(). However, those APIs were only added in Marshmallow, API 23. This was long standing feature request for ExoPlayer that has recently been implemented and is available back to API 16.
Upvotes: 2