Giter VIP home page Giter VIP logo

Comments (6)

happyleavesaoc avatar happyleavesaoc commented on June 20, 2024 1

Hi, specify the full path like so:

uri = 'file://' + os.path.abspath('2.mp3')

from gstreamer-player.

curiouswala avatar curiouswala commented on June 20, 2024

Here is the code

from gsp import GstreamerPlayer
import os

filename = '1cut.mp3'
print(os.path.exists(os.path.abspath(filename))) # This is true for me
player = GstreamerPlayer(None)
uri = 'file://'+os.path.abspath(filename)
player.queue(uri)

Here is the new result

/home/hasan/moodio_env/bin/python /home/hasan/PycharmProjects/audioplayer/wrapplayer.py
Process GstreamerProcess-2:
Traceback (most recent call last):
  File "/usr/lib/python3.5/multiprocessing/managers.py", line 709, in _callmethod
    conn = self._tls.connection
AttributeError: 'ForkAwareLocal' object has no attribute 'connection'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
    self.run()
  File "/home/hasan/moodio_env/lib/python3.5/site-packages/gsp/__init__.py", line 94, in run
    self.media(uri)
  File "/home/hasan/moodio_env/lib/python3.5/site-packages/gsp/__init__.py", line 118, in media
    self.state = STATE_PLAYING
  File "/home/hasan/moodio_env/lib/python3.5/site-packages/gsp/__init__.py", line 166, in state
    self._manager[ATTR_STATE] = state
  File "<string>", line 2, in __setitem__
  File "/usr/lib/python3.5/multiprocessing/managers.py", line 713, in _callmethod
    self._connect()
  File "/usr/lib/python3.5/multiprocessing/managers.py", line 700, in _connect
    conn = self._Client(self._token.address, authkey=self._authkey)
  File "/usr/lib/python3.5/multiprocessing/connection.py", line 487, in Client
    c = SocketClient(address)
  File "/usr/lib/python3.5/multiprocessing/connection.py", line 614, in SocketClient
    s.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

Process finished with exit code 0

mp3 file exists in the same dir
Could virtualenv affect it in any way?

from gstreamer-player.

happyleavesaoc avatar happyleavesaoc commented on June 20, 2024

Try dropping the file://.

from gstreamer-player.

jeena avatar jeena commented on June 20, 2024

I have the same problem.

from gstreamer-player.

tschmidty69 avatar tschmidty69 commented on June 20, 2024

I have a similar issue @happyleavesaoc I can play from the command line and from within my python venv for hass

Python 3.6.3 (default, Oct  3 2017, 21:45:48)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gsp import GstreamerPlayer
>>> pipeline = 'mpegaudioparse ! mpg123audiodec ! audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo'
>>> player = GstreamerPlayer(pipeline)
>>> player.queue('https://myserver/api/tts_proxy/a0f58f7e9238b8d577822294c20673c243bd091f_en-gb-wls_8567674757942596877_amazon_polly.mp3')
>>> gst-resource-error-quark: Error while seeking in file "/tmp/snapfifo". (11)

But when trying to play withing hass with the same parameters

 ERROR (SyncWorker_2) [gsp] gst-resource-error-quark: Could not open resource for reading. (5)

from gstreamer-player.

pitoulambert avatar pitoulambert commented on June 20, 2024

I got the same problem while using the bbc/brave (audio/video) api editor

ERROR: [ output1] GStreamer error from sink: gst-resource-error-quark: Error while writing to file "/usr/local/share/brave/output_images/img_19777.jpg". (10)
ERROR: [ output1] GStreamer error debug: gstmultifilesink.c(793): gst_multi_file_sink_write_buffer (): /GstPipeline:pipeline25/GstMultiFileSink:sink:
No such file or directory
ERROR: [ output1] GStreamer error message: Error while writing to file "/usr/local/share/brave/output_images/img_19777.jpg".

I need your help please

from gstreamer-player.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.