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

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

问题描述

默认动态壁纸随我的手机之一是,在实时背景中显示的音乐播放波形墙纸。我想知道如何可以去这样做。看来我应该以某种方式访问​​背景音乐的流数据,并计算实时采样,但我不知道如何获得流数据。我想我可以按照本教程<一个显示波形href="http://$c$cidol.com/java/swing/Audio/Build-an-Audio-Waveform-Display/">http://$c$cidol.com/java/swing/Audio/Build-an-Audio-Waveform-Display/,但我不完全知道如何做到这一点。帮助将不胜AP preciated /

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/

推荐答案

有一个Android类称为可视化,可以让你访问音频播放 <一href="http://developer.android.com/reference/android/media/audiofx/Visualizer.html">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

此外,由于Android是所有开源的,你可以看看如何动态壁纸做它! <一href="http://android.git.kernel.org/?p=platform/packages/wallpapers/MusicVisualization.git;a=tree;f=src/com/android/musicvis;hb=HEAD">http://android.git.kernel.org/?p=platform/packages/wallpapers/MusicVisualization.git;a=tree;f=src/com/android/musicvis;hb=HEAD

In addition, since Android is all open source, you can look at how the live wallpaper does it! http://android.git.kernel.org/?p=platform/packages/wallpapers/MusicVisualization.git;a=tree;f=src/com/android/musicvis;hb=HEAD

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

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