Android : How to change Playback Rate of music using OpenSL ES

前端 未结 2 924
你的背包
你的背包 2020-11-30 22:23

I am working on a music player in which I need to change tempo (playback speed of music) without changing the pitch.

I\'m not able to find any native android class

2条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 23:06

    This may be of some help (taken from the NDK OpenSL documentation):

    Playback rate

    The supported playback rate range(s) and capabilities may vary depending on the platform version and implementation, and so should be determined at runtime by querying with PlaybackRate::GetRateRange or PlaybackRate::GetCapabilitiesOfRate.

    That said, some guidance on typical rate ranges may be useful: In Android 2.3 a single playback rate range from 500 per mille to 2000 per mille inclusive is typically supported, with property SL_RATEPROP_NOPITCHCORAUDIO. In Android 4.0 the same rate range is typically supported for a data source in PCM format, and a unity rate range for other formats.

提交回复
热议问题