开发者

Recording\Playing audio directly with libmedia\AudioFlinger

开发者 https://www.devze.com 2023-02-28 01:41 出处:网络
I\'m checking out the possibility of interfacing directly to libmedia\\AudioFlinger for playing\\recording raw audio (like AudioTrack\\AudioRecord do).

I'm checking out the possibility of interfacing directly to libmedia\AudioFlinger for playing\recording raw audio (like AudioTrack\AudioRecord do).

The purpose is to workaround the minimum buffer size limitation of those 2 Java classes. I know that 2.3 introduces OpenSL, but I want to do that for 2.2 and below.

Has anyone don开发者_开发知识库e that before? Is there any good reference implementation that uses that? If not, how would you approach linking against this library and using it to workaround the minimum buffer size?

Thanks


Unfortunately there are only two supported audio APIs available, and you have mentioned both (AudioTrack and OpenSL). Any lower level than that and you would be interfering with the audio mixing already being done by the device for things like SFX and phone calls. Also as there is no API for lower layer audio you would need to go hacking, which probably isn't what you want to do for obvious compatibility reasons.

0

精彩评论

暂无评论...
验证码 换一张
取 消