Play music from memory in Android

妖精的绣舞 提交于 2019-12-11 07:41:41

问题


Is there a way to play a song that exists as an array of bytes in memory and not as a file on disk?

I know I could save it in a file temporarily and play it form there but I'd like to avoid this as I'm trying to implement a DRM system that will not expose unencrypted media files.


回答1:


You can use AudioTrack. But it supports raw LPCM data only.



来源:https://stackoverflow.com/questions/6425778/play-music-from-memory-in-android

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