Java 中最快、最高效的音频上采样例程
我需要将音频样本从 11025 和 22050 转换为 44100;我正在寻找最快且听起来最好的转换例程。我要求用纯 Java 给出答案,而不需要外部例程或库。源是代表左声道和右声道的短值数组,像这样交错 LRLRLRLR
我听说高斯变换是最好的,但它是CPU杀手。
更新
为了添加更多细节,我想要最好和最快的混合。答案将提供适合近实时通信的出色音质。
更新2
我正在寻找一些简短的代码示例,应该是您音频大师的 ez 点
I have a need to convert audio samples from 11025 and 22050 to 44100; I'm looking for the fastest and best sounding conversion routine. I require that the answer be given in pure Java, without the need for external routines or libraries. The source is an array of short values representing left and right channels, interleaved like so LRLRLRLR
I've heard that gaussian transformation is the best, but it is a cpu killer.
Update
To add more detail, I would like a mix between best and fastest. The answer would give great sounding audio suitable for near real-time communication.
Update 2
I'm looking for some short code examples for this one, should be ez points for you audio guru's
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以(最终)在用 0 填充每个其他样本后使用 fir - 你将上采样 2 或 4。这对于实时来说会很快。对于大多数应用程序来说,音频质量都很好。
you can (ultimately) just use a fir after filling every other sample with 0s - you're upsampling by 2 or 4. this will be plenty fast for realtime. audio quality will be fine for most applications.
嗯,很难以足够慢的速度重新采样,因此它不是实时的:-)
最好的之一&仍然快速的解决方案是进行正向 FFT,然后以您需要的任何采样率进行反向 FFT。
您可以自己实现,或者复制并使用它。粘贴任何 FFT 实现。
这可能像 100 倍实时或更快,不确定您是否需要 1000 倍更快(在这种情况下,您可以使用线性或双三次插值):-)
Well, it is hard to resample it slow enough so that it is not realtime :-)
One of the best & still fast solutions is to do forward FFT, and then do reverse FFT with any sample rate you need.
You may implement this on your own, or copy & paste any FFT implementation.
This might work like 100x realtime or faster, not sure you need 1000x faster (in this case you can go for linear or bicubic interpolation) :-)