Java 声音剪辑循环帧位置
我对循环剪辑有一个小问题: 如果您有一个声音文件,例如 20000 个样本长,则循环后帧位置不会重置,因此我得到的值是原始声音文件“超出范围”的值。 当我想在波形上绘制位置标记时,我有点困惑如何实现。此时我只是得到 myClip.getLongFramePosition() 但这并不像上面描述的那样工作。
有谁知道如何解决这个问题?是否可以计算剪辑之前循环播放的频率?
问候
I have a little problem with a loopting clip:
If you have a soundfile e.g. 20000 samples long, the frame position will not reset after looping, so I get values that are "out of bounds" of the original soundfile.
As I want to draw a position marker on my waveform, I'm a bit confused how to achive. At this time I just get myClip.getLongFramePosition() but this does not work as described above.
Does anyone have an idea how to fix that? Is there a possibility to count how often a clip was looped before?
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您要循环整个音频文件而不仅仅是一部分,您可以调用 int getFrameLength() 来找出音频文件的长度,然后检查 getLongFramePosition() 的值以及它是否超过文件的长度然后使用模函数(除以长度并取余数)来找出实际位置。
If you are looping the whole audio file and not just a portion you could possibly call int getFrameLength() to find out what the length of your audio file is then check the value of getLongFramePosition() and if it is over the length of your file then use a modulus function (divide by the length and take the remainder) to find out what the actual position is.