在Android中播放内存中的音乐 [英] Play music from memory in Android

查看:93
本文介绍了在Android中播放内存中的音乐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以播放以内存中的字节数组而不是磁盘上的文件形式存在的歌曲?

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

我知道我可以暂时将其保存在文件中并在那里播放,但是在尝试实现不会暴露未加密媒体文件的DRM系统时,我想避免这种情况.

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.

推荐答案

您可以使用 AudioTrack .但是它仅支持原始LPCM数据.

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

这篇关于在Android中播放内存中的音乐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆