我可以从MediaPlayer或SoundPool获得原始PCM数据吗? [英] Can I get raw PCM data from MediaPlayer or SoundPool?

查看:303
本文介绍了我可以从MediaPlayer或SoundPool获得原始PCM数据吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将eclipse与android sdk 4.0.3 api lvl 15一起使用来创建基本的音乐播放器应用程序.

i use eclipse with android sdk 4.0.3 api lvl 15 to create a basic music player application.

我阅读并发现有两个主要的类来播放声音. MediaPlayer和SoundPool. SoundPool在声音优先级和播放声音的速率方面具有更大的灵活性.

I read and found that there are two main classes to play sounds. MediaPlayer and SoundPool. SoundPool has more flexibility regarding sound priority and rate of played sound.

我还想绘制音频的可视化图.

I would also like to draw a visualization graph of the audio.

是否有一种方法可以从加载的音频资产中获取原始PCM数据,以便我能够绘制图形?

is there a way to get raw PCM data from the loaded audio asset in order for me to be able to draw the graph ?

有没有一种方法可以在实时播放原始数据之前对其进行处理?例如,如果我想添加实时效果.这些类有可能吗?或任何其他?

is there a way to manipulate the raw data before it's being played on realtime? for example if i want to add real time effects. is that possible with these classes ? or any other ?

我要使用这些类之一的主要原因是因为它们可以读取音频格式,而无需我自己读取文件并将其解析为原始PCM数据.

the main reason that I want to use one of these classes because they can read audio formats without me needing to read the file and parse the formats to raw PCM data myself.

有关此问题的任何信息将不胜感激.

any information regarding the issue would be greatly appreciated.

谢谢!

Kfir

推荐答案

我已经完成了一个开源项目.

I have been go through one open source project .

因为他们已经加载了音频文件的PCM.

in that they have loaded PCM of audio file .

这是链接

希望它可以帮助您从音频文件中提取PCM.

hope its help you draw PCM from audio file .

这篇关于我可以从MediaPlayer或SoundPool获得原始PCM数据吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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