开发者

gstreamer: play audio file backwards in

I want to play audio files with different playback rates using GStreamer. This already works fine. However, in contrast to the Python GStreamer reference, negative rates do not play the audio file backwards.

Doe开发者_运维技巧s anybody know how to accomplish my goal? Has this something to do with filesrc or decodebin2 not being able to buffer the file for playing in reverse? Or is this simply a bug?

Here's a (veeery) simplified version of my code:

import os

import pygst
pygst.require('0.10')
import gst
import gtk


gst_command = ('filesrc location=%s ! decodebin2 ! autoaudiosink') % \
    '/mnt/audio/test.wav'
pipeline = gst.parse_launch(gst_command)
pipeline.set_state(gst.STATE_PLAYING)
pipeline.get_state()

position = 10 * gst.SECOND
rate = -1.0
pipeline.seek(rate, gst.FORMAT_TIME, \
           gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE, \
           gst.SEEK_TYPE_SET, position, \
           gst.SEEK_TYPE_NONE, -1)

gtk.main()

I'm familiar with other programming languages than Python, so do not hesitate to answer using your favorite language... :)


It seems the debug output says:

0:00:00.447509530  6848      0x10d6e30 DEBUG               wavparse gstwavparse.c:1020:gst_wavparse_perform_seek:<wavparse0> negative playback rates are not supported yet.

so you should file a bug to request this be implemented, or implement it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜