Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu gstreamer:没有可用于类型';音频/x-wav';/没有找到合适的插件_Ubuntu_Kivy_Gstreamer - Fatal编程技术网

Ubuntu gstreamer:没有可用于类型';音频/x-wav';/没有找到合适的插件

Ubuntu gstreamer:没有可用于类型';音频/x-wav';/没有找到合适的插件,ubuntu,kivy,gstreamer,Ubuntu,Kivy,Gstreamer,我开发了一个Kivy Python应用程序。它应该有一个良好的效果。 在Kivy中,它很简单: from kivy.core.audio import SoundLoader ... def btn(self): sound = SoundLoader.load("images/crunch.ogg") if sound: sound.play() 当这段代码运行时,我得到: [WARNING] [AudioG

我开发了一个Kivy Python应用程序。它应该有一个良好的效果。 在Kivy中,它很简单:

from kivy.core.audio import SoundLoader
...
    def btn(self):
        sound = SoundLoader.load("images/crunch.ogg")
        if sound:
            sound.play()
当这段代码运行时,我得到:

[WARNING] [AudioGstplayer] b"No decoder available for type 'audio/x-wav'."
[ERROR  ] [AudioGstplayer] b'Your GStreamer installation is missing a plug-in.'
[ERROR  ] [AudioGstplayer] b'Internal data stream error.'
我知道Kivy使用GStreamer。因此,我尝试在终端中使用其基本实用程序播放声音:

(base) $ gst-play-1.0 -v PycharmProjects/dima_kivy/images/crunch.wav
Press 'k' to see a list of keyboard shortcuts.
Now playing /home/slv/PycharmProjects/dima_kivy/images/crunch.wav
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: buffer-size = -1
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: buffer-duration = -1
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: use-buffering = false
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: download = false
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: uri = file:///home/slv/PycharmProjects/dima_kivy/images/crunch.wav
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: connection-speed = 0
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: source = "\(GstFileSrc\)\ source"
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = audio/x-wav
WARNING No decoder available for type 'audio/x-wav'.
WARNING debug information: gsturidecodebin.c(921): unknown_type_cb (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0
ERROR Your GStreamer installation is missing a plug-in. for file:///home/slv/PycharmProjects/dima_kivy/images/crunch.wav
ERROR debug information: gsturidecodebin.c(988): no_more_pads_full (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
gstdecodebin2.c(4679): gst_decode_bin_expose (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found:
Missing decoder: WAV (audio/x-wav)
看来问题不在于基维。 我在谷歌上搜索了一些安装帮助的人,我也这样做了:

sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
运行此“全部安装”命令不会改变任何内容。行为保持不变。 我想可能有一些错误的配置,但我甚至不知道在哪里可以找到(

求求你,救命

我的系统:Ubuntu 20.04.1 LTS

gst-inspect-1.0输出:

(base) slv@slv-ubuntu-comp:~$ gst-inspect-1.0 audio/x-wav
Factory Details:
  Rank                     primary (256)
  Name                     audio/x-wav
  Caps                     audio/x-wav
  Extensions               wav

Plugin Details:
  Name                     typefindfunctions
  Description              default typefind functions
  Filename                 /home/slv/miniconda3/lib/gstreamer-1.0/libgsttypefindfunctions.so
  Version                  1.14.5
  License                  LGPL
  Source module            gst-plugins-base
  Source release date      2019-05-29
  Binary package           GStreamer Base Plug-ins source release
  Origin URL               Unknown package origin


最后我发现,当我使用conda安装时:

conda install kivy -c conda-forge
我不小心也在conda环境中创建了它,结果是gstreamer标准Ubuntu安装的系统路径被覆盖。 因此,我通过移除康达环境中的kivy,修复了我的基础conda环境。 现在命令gst-play-1.0~/PycharmProjects/dima_kivy/images/crunch.wav运行良好,在基本环境中产生预期的声音

至于在我的开发环境中出现的错误“gstreamer:No decoder available for type'audio/x-wav'/找不到合适的插件”,我已经向前迈出了一步,在我的开发环境中安装了conda forge的good插件,如下所示:

conda install gst-plugins-good -c conda-forge
它修复了标题中提到的错误,但我的电脑仍然没有声音。 对于这个新问题,我将向stackoverflow社区提出另一个问题

conda install gst-plugins-good -c conda-forge