有什么办法可以改变Android或Java中WAV(或MP3)的采样频率?
我正在尝试在 Android 中通过单声道 (SCO) BT 耳机播放文件。这些文件的频率必须为 8000 Hz,但我的频率是 44100 Hz。这些文件是 MP3,但我已经创建了将它们转换为 WAV 的代码,因为我知道 Android 本身不处理 MP3。
这必须在执行时在设备上完成,所以有人可以提供任何建议吗?
我应该提到的是,我不在乎文件最终采用什么格式,只要它们可以使用 MediaPlayer 播放即可。
I'm trying to get files played through a mono (SCO) BT headset in Android. The files have to have an 8000 Hz frequency, but the ones I have are 44100 Hz. The files are MP3s, but I've already created code to convert them to WAVs, since I know that Android doesn't handle MP3s natively.
This has to be done on the device at execution time,so can anyone offer any suggestions?
I should mention that I don't care what format the files end up in, as long as they can be played back using MediaPlayer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
44100/8000=5.5125
所以你可以尝试采集 5.5125 个样本并计算平均值,从而降低采样率
我认为这应该可行,尽管我确信结果会很吵,但值得尝试
你也可以采集每个 5.5125 个样本
也许这可以帮助你
http://en.wikipedia.org/wiki/Downsampling
44100/8000=5.5125
so you can try to take 5.5125 samples and calculate the average value and so reduce the sample rate
I think this should work although Im sure the result will be noisy but ist worth trying
you can also take every 5.5125 sample
maybe this can help you
http://en.wikipedia.org/wiki/Downsampling