如何绘制Android音乐播放器的波形? [英] How to draw waveform of Android's music player?

查看:38
本文介绍了如何绘制Android音乐播放器的波形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的手机自带的默认动态壁纸之一是实时显示背景中播放的音乐波形的壁纸.我想知道如何才能做到这一点.看来我应该以某种方式访问​​背景音乐的流数据并实时计算样本,但我不知道如何获取流数据.我想我可以按照本教程显示波形 http://codeidol.com/java/swing/Au​​dio/Build-an-Audio-Waveform-Display/,但我不确定如何去做.帮助将不胜感激/

one of the default live wallpapers that came with my phone was a wallpaper that displayed the wave form of music playing in the background in real time. I was wondering how one could go about doing this. It seems I should somehow access the streaming data of the background music and compute the samples in real time, but I have no idea how to get the streaming data. I think I can display the wave form by following this tutorial http://codeidol.com/java/swing/Audio/Build-an-Audio-Waveform-Display/, but I'm not exactly sure how to do it. Help would be greatly appreciated/

推荐答案

有一个名为 Visualizer 的 Android 类可让您访问正在播放的音频http://developer.android.com/reference/android/media/audiofx/Visualizer.html

There is an Android class called Visualizer that lets you access audio being played http://developer.android.com/reference/android/media/audiofx/Visualizer.html

另外,由于安卓都是开源的,大家可以看看动态壁纸是怎么做的!https://android.googlesource.com/platform/packages/wallpapers/MusicVisualization/

In addition, since Android is all open source, you can look at how the live wallpaper does it! https://android.googlesource.com/platform/packages/wallpapers/MusicVisualization/

这篇关于如何绘制Android音乐播放器的波形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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