What does “status -12” mean in Android AudioTrack?

主宰稳场 提交于 2019-12-21 15:00:45

问题


When using Android soundpool/audioTrack, I keep getting the following error:

AudioFlinger could not create track, status: -12
Error creating AudioTrack

Can anyone explain what -12 is? Is it the value of some enum from the source code?

I've seen other questions that deal with error -12 but nowhere conclusively do I see what that constant actually stands for. Does someone know the list of the possible statuses for AudioFlinger? I've also seen error -22 around, but I don't know what that means either.

Answers backed up by source code or documentation would be best, but I'll take any information I can get at this point.


回答1:


-12 is ENOMEM Not enough space

-22 is EINVAL Invalid argument. 

These are standard POSIX error codes




回答2:


-12 means that you can not create a track anymore. Android Audio Framework allows only 32 tracks(includes playing/stopped/paused/...) per mixer thread at the same time.

try to remove some apps on background, you can create one.



来源:https://stackoverflow.com/questions/12471979/what-does-status-12-mean-in-android-audiotrack

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