简体   繁体   中英

Java Sound Clip Looping Frame Position

I have a little problem with a loopting clip: If you have a soundfile eg 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

如果要遍历整个音频文件而不是仅循环一部分,则可以调用int getFrameLength()来查找音频文件的长度,然后检查getLongFramePosition()的值以及它是否超出文件的长度然后使用模数函数(除以长度,然后取余数)来找出实际位置。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM