mp3 转 wav
gst-launch-1.0 filesrc location=1.mp3 ! decodebin ! audioresample \
! audioconvert ! audio/x-raw,format=S24LE,rate=48000 ! wavenc \
! filesink location=out.wav
利用speex 编解码 插件:
源代码出自https://stackoverflow.com/questions/32564312/problems-with-using-speex-in-gstreamer-in-python, 根据评论的解决方法做了修改, 可以播放录音
主要的修改在于在speexenc 前添加, audioconvert 和 audioresample,
import gi
gi.require_version('Gst', '1.0')
gi.require_version('Gtk', '3.0')
from gi.repository import GObject, Gst, Gtk
# Initializing threads used by the Gst various elements
GObject.threads_init()
#Initializes the GStreamer library, setting up internal path lists, registering bu