增加java的声音文件的播放速度 [英] Increase playback speed of sound file in java
问题描述
我正在寻找的信息,我怎么能增加使用Java声音文件的播放速度和它的声音API。
I'm looking for information on how I can increase the playback speed of a sound file using Java and it's sound API.
我目前使用的剪辑和的AudioInputStream来播放该文件,但我会很高兴来改变,如果这意味着我可以提高播放速度。
I'm currently using a clip and an AudioInputStream to play back the file, but I'll be glad to change that if it means I can increase the playback speed.
推荐答案
我用线性插值法做到这一点。当你被一些增量通过你的样品步骤,用尾数距离创造价值流。
I do this by using linear interpolation. As you step through your samples by some increment, use the fractional distance to create a value to stream.
例如,如果你降落在1.25(采样之间,值10和值30个样本),你将输出值15。
For example if you land at 1.25 (between a sample with value 10 and sample of value 30), you would output a value of 15.
这篇关于增加java的声音文件的播放速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!