开发者

Java Sound Clip Looping Frame Position

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 des开发者_运维知识库cribed above.

Does anyone have an idea how to fix that? Is there a possibility to count how often a clip was looped before?

Regards


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜