Android soundpool rate range?

为君一笑 提交于 2019-12-07 17:00:53

问题


Android's soundpool.play [documentation][1] says "The playback rate allows the application to vary the playback rate (pitch) of the sound. A value of 1.0 means play back at the original frequency. A value of 2.0 means play back twice as fast, and a value of 0.5 means playback at half speed.".

However, when I set the rate to 1.49f, I hear silence. 1.485f renders correctly (it's ogg file). Is this specific to my handset, is the documentation wrong, or am I being foolish in some other way?

[1]: http://developer.android.com/reference/android/media/SoundPool.html#play(int, float, float, int, int, float)


回答1:


I'm sort of new at this, but I'm pretty sure it needs to be 0.5f, 1f, or 1.5f and no other values. It's not specific to any particular ogg file. I do know it changes the pitch during playback in soundmanager. Since no one else answered, I figured my answer might be better than no answer.



来源:https://stackoverflow.com/questions/2291531/android-soundpool-rate-range

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!