在xuggler中转发和倒带音频 [英] forwarding and rewinding audio in xuggler

查看:114
本文介绍了在xuggler中转发和倒带音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用xuggler播放wav,au,aiff以外的音频文件.由于xuggler以较低的级别执行音频解码,因此很难编写一种方法来转发和倒带正在播放的音频. (在解码xuggler时会分析每个数据包,然后将其发送以播放)

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)

一种方法可以一次读取一堆数据包,然后发送下一个数据包播放.这样可以感觉到转发音频的效果. But i don't know how to implement this method而且,这不是我转发数据的最佳方法.

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 Moreover this is not the best way i can forward the data.

是否有直接方法来转发和倒带音频?如果不是直接指定什么算法,该怎么做?

推荐答案

您是否看过IContainer中的seekKeyFrame()方法?参见

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.

这篇关于在xuggler中转发和倒带音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆