访问音频可视化Android的媒体流音频、媒体、Android

2023-09-12 03:50:47 作者:以治丧丧

基本上,我想打一个音频可视化。我知道这是可能的,因为我的手机附带了一些动态壁纸的做到这一点。问题是,我似乎无法弄清楚如何与And​​roid的API做到这一点。

Basically, I want to make an audio visualizer. I know it's possible, because my phone came with a few live wallpapers that do it. The problem is, I can't seem to figure out how to do this with the Android API.

我的应用程序便拿起当前播放的媒体流,然后根据正在播放当时的音量时,它会显示更多或更少的栏在屏幕上。

My app would pick up the currently playing media stream and then depending upon the volume that is playing at that time, it would display more or less bars on the screen.

我怎样才能做到这一点?它看起来像我可以做这样的事情使用麦克风,但我希望能够做到这一点的音乐,播客等。

How can I do this? It looks like I could do something like this using the microphone, but I want to be able to do it for music, podcasts, etc.

推荐答案

在 MusicVisualization壁纸来源可在 AOSP 。基本上,它似乎涉及调用 MediaPlayer.snoop() ,在巧克力慕斯蛋糕添加了一个未公开的方法。

The MusicVisualization wallpaper source is available at the AOSP. It basically seems to involve calling MediaPlayer.snoop(), an undocumented method added in Eclair.

 
精彩推荐
图片推荐