访问 Android 媒体流以进行音频可视化 [英] Accessing the Android media stream for audio visualization

查看:30
本文介绍了访问 Android 媒体流以进行音频可视化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我想做一个音频可视化工具.我知道这是可能的,因为我的手机附带了一些可以做到的动态壁纸.问题是,我似乎不知道如何使用 Android 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(),Eclair 中添加的未公开方法.

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

这篇关于访问 Android 媒体流以进行音频可视化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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