AudioTrack setStereoVolume deprecated

£可爱£侵袭症+ 提交于 2020-01-04 06:14:26

问题


I did not manage to find solution what to use instead of deprecated AudioTrack's method setStereoVolume.

There is info about this in reference, but I am not sure how to use setVolume for muting left/right channel.

This method was deprecated in API level 21. Applications should use setVolume(float) instead, as it more gracefully scales down to mono, and up to multi-channel content beyond stereo.

I need to play only one channel at a time, but I cannot find appropriate solution. I've already checked solution with LRLRLR samples, and playing one channel by setting every 2nd sample to 0, but did not help.

Thank you.

来源:https://stackoverflow.com/questions/37309473/audiotrack-setstereovolume-deprecated

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