FreeLanguageTools/vocabsieve

audio won't play

Closed this issue · 5 comments

Describe the bug
A clear and concise description of what the bug is.
when look up word and click pronunciation, audio won't play

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: linux(ubuntu22.04) i3wm
  • Vocabsieve version (if nightly, must be latest):appimage 0.10.2

Additional context
Add any other context about the problem here.
here is what happen in terminal after i press play button and expect audio to play:

  • Debug mode: off
    Traceback (most recent call last):
    File "/home/exia/.local/lib/python3.10/site-packages/vocabsieve/playsound.py", line 266, in
    playsound(argv[1])
    File "/home/exia/.local/lib/python3.10/site-packages/vocabsieve/playsound.py", line 180, in _playsoundNix
    playbin.props.uri = 'file://' + pathname2url(path)
    AttributeError: 'NoneType' object has no attribute 'props'
    Exception in thread Thread-2 ():
    Traceback (most recent call last):
    File "/tmp/.mount_vocabsta0wt9/opt/python3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
    File "/tmp/.mount_vocabsta0wt9/opt/python3.10/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
    File "/home/exia/.local/lib/python3.10/site-packages/vocabsieve/dictionary.py", line 271, in
    Thread(target=lambda: playsound(relative_audio_path)).start()
    File "/home/exia/.local/lib/python3.10/site-packages/vocabsieve/playsound.py", line 259, in
    playsound = lambda sound, block = True: _playsoundAnotherPython('/usr/bin/python3', sound, block, macOS = False)
    File "/home/exia/.local/lib/python3.10/site-packages/vocabsieve/playsound.py", line 234, in _playsoundAnotherPython
    t.join()
    File "/home/exia/.local/lib/python3.10/site-packages/vocabsieve/playsound.py", line 223, in join
    raise self.exc
    File "/home/exia/.local/lib/python3.10/site-packages/vocabsieve/playsound.py", line 216, in run
    self.ret = self._target(*self._args, **self._kwargs)
    File "/home/exia/.local/lib/python3.10/site-packages/vocabsieve/playsound.py", line 231, in
    t = PropogatingThread(target = lambda: check_call([otherPython, playsoundPath, _handlePathOSX(sound) if macOS else sound]))
    File "/tmp/.mount_vocabsta0wt9/opt/python3.10/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/bin/python3', '/home/exia/.local/lib/python3.10/site-packages/vocabsieve/playsound.py', '/home/exia/.local/share/FreeLanguageTools/VocabSieve/forvo/en/imscotte1/hello.mp3']' returned non-zero exit status 1.

Can you check if this is reproducible on the latest master appimage?

https://nightly.link/FreeLanguageTools/vocabsieve/workflows/build-binaries/master

The audio handling part has been already rewritten and I will make a new release soon, so I won't be fixing the earlier version. Note that if you decide to use this nightly version you should not try downgrade back to 0.10.2.

This is what happened when I tried with v0.11.0. This particular behavior only occurs (both v0.10.0 and v0.11.0;audio won't play)when I try this app in i3 WM, but with normal ubuntu(wayland) or Xorg ubuntu it works fine.
//i3
Here is what was shown in the terminal after I tried to reproduce that behavior on v0.11.0 on i3WM.
2023-12-16 11:46:07.487 | INFO | vocabsieve.main:lookupSelected:608 - Triggered lookup on world
Forvo lookup world
Error: "" : "no element "identity""

(python3.10:5649): GLib-GObject-CRITICAL **: 11:46:09.471: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(python3.10:5649): GStreamer-CRITICAL **: 11:46:09.471: gst_object_ref: assertion 'object != NULL' failed

(python3.10:5649): GStreamer-CRITICAL **: 11:46:09.471: gst_bin_add_many: assertion 'GST_IS_ELEMENT (element_1)' failed

(python3.10:5649): GStreamer-CRITICAL **: 11:46:09.471: gst_element_link_pads_full: assertion 'GST_IS_ELEMENT (src)' failed

(python3.10:5649): GStreamer-CRITICAL **: 11:46:09.471: gst_element_get_static_pad: assertion 'GST_IS_ELEMENT (element)' failed

(python3.10:5649): GStreamer-CRITICAL **: 11:46:09.471: gst_ghost_pad_new: assertion 'GST_IS_PAD (target)' failed

(python3.10:5649): GStreamer-CRITICAL **: 11:46:09.471: gst_element_add_pad: assertion 'GST_IS_PAD (pad)' failed

(python3.10:5649): GStreamer-CRITICAL **: 11:46:09.471: gst_object_unref: assertion 'object != NULL' failed
URLError(ConnectionRefusedError(111, 'Connection refused'))
2023-12-16 11:47:34.476 | DEBUG | vocabsieve.main:getKnownDataOnThread:359 - Some data sources aren't available, not getting known data now
URLError(ConnectionRefusedError(111, 'Connection refused'))
2023-12-16 11:50:33.179 | DEBUG | vocabsieve.main:getKnownDataOnThread:359 - Some data sources aren't available, not getting known data now

No idea what happened. If it works properly on DEs and not a pure x11 wm environment, I'd maybe try making sure things like dbus, etc, is running. We aren't using anything from GTK directly, only via Qt's media player. Do other gstreamer programs or other audio playing programs work properly on your i3?

I don't know if this going to help or not.but yes my rhythm box work fine.

now I don't know what's going on.It work when I ran the program from rofi or ran with sudo from terminal.and I think that solves my problem for now.Thank you for your time and this amazing tool.