开发者

forwarding and rewinding audio in xuggler

开发者 https://www.devze.com 2023-03-25 02:40 出处:网络
I have used xuggler to play audio files other than wav,au,aiff. Since xuggler performs audio decoding at low level it is very hard to write a method that both forwards and rewinds the audio being play

I have used xuggler to play audio files other than wav,au,aiff. Since xuggler performs audio decoding at low level it is very hard to write a method that both forwards and rewinds the audio being played . ( while decoding xuggler analyzes each data packet and then sends it to play)

One way could be read bunch of packets at a time and then send the next packet to play.This way the effect of forwarding audio can be felt . But i don't know how to implement this method Moreove开发者_如何学编程r this is not the best way i can forward the data.

Are there any direct methods to forward and rewind audio ? If not direct what is the algorithm , steps to do this ?


Have you looked at the seekKeyFrame() method in IContainer? See here. On seek, you could just flush the dataline and then on execution of the method the container should jump to the given location.

If you want to do it by a percentage call, then getDuration() gets the entire length of the stream (if available.) You can then work out accurate timestamps from there.

0

精彩评论

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

关注公众号