在xuggler中转发和倒带音频

编程入门 行业动态 更新时间:2024-10-24 04:35:48
本文介绍了在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.

如果您想通过百分比致电来执行此操作,请 getDuration()获取流的整个长度(如果可用).然后您可以从那里计算出准确的时间戳.

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中转发和倒带音频

本文发布于:2023-07-11 09:16:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1093554.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:音频   xuggler

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!