Android的卡拉OK文本? [英] Android Karaoke Text?

查看:152
本文介绍了Android的卡拉OK文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在抓我的头在过去的一周做的文字这种效果。 http://www.youtube.com/watch?v=gB2PL33DMFs&feature=related
将是巨大的,如果有人可以给我如何做一些提示或指导或教程。

I have been scratching my head for the past week to do this effect on the text. http://www.youtube.com/watch?v=gB2PL33DMFs&feature=related Would be great if someone can give me some tips or guidance or tutorial on how to do this.

thankz阅读和应答= D

thankz for reading and answering =D

推荐答案

如果你想要的是显示一个电影的视频和声音,的 MediaPlayer的能做到这一点很容易。

If all you want is to display a movie with video and sound, a MediaPlayer can do that easily.

所以,我认为你实际上是在谈论同步某种动画显示了声音文件被单独播放。我们这样做是使用的MediaPlayer和投票 getCurrentPosition 从动画循环中。这个或多或少的作品,但也有需要克服的严重问题。 (所有这一切都处理与播放MP3文件,我们没有尝试的任何其他音频格式)。

So I assume that you're actually talking about synchronizing some sort of animated display with a sound file being played separately. We did this using a MediaPlayer and polling getCurrentPosition from within an animation loop. This more or less works, but there are serious problems that need to be overcome. (All this deals with playing mp3 files; we didn't try any other audio formats).

首先,你的MP3的必须的被在44,100 Hz的采样率记录。否则按 getCurrentPosition返回的值的路要走。 (我们认为这是由实际的采样率,以44,100的比例缩放,但我们并没有验证这一假设。)128000比特率,似乎是最好的。

First, your mp3 must be recorded at 44,100 Hz sampling rate. Otherwise the value returned by getCurrentPosition is way off. (We think it's scaled by the ratio of the actual sampling rate to 44,100, but we didn't verify this hypothesis.) A bit rate of 128,000 seems to work best.

其次,更严重的是,由 getCurrentPosition 返回的值似乎脱出设备的声音渐行渐远随着时间的推移。约45秒后,该开始是相当明显的。更糟糕的是,这种漂移显著不同的(但总是present)在不同的操作系统层,也许从设备到设备。 (我们2.1和2.2两个模拟器和真正的设备,以及3.0模拟器测试这一点)。我们怀疑某种缓冲问题,但无法真正诊断它。我们的解决方法是不再mp3文件分解成短段和链中的播放。很多簿记恶化。这仍然是在测试,但到目前为止,它似乎已经奏效。

Second, and more serious, is that the values returned by getCurrentPosition seem to drift away over time from the sound coming out of the device. After about 45 seconds, this starts to be quite noticeable. What's worse is that this drift is significantly different (but always present) in different OS levels, and perhaps from device to device. (We tested this in 2.1 and 2.2 on both emulators and real devices, and 3.0 on an emulator.) We suspected some sort of buffering problem, but couldn't really diagnose it. Our work-around was to break up longer mp3 files into short segments and chain their playback. Lots of bookkeeping aggravation. This is still under test, but so far it seems to have worked.

这篇关于Android的卡拉OK文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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