Coder Social home page Coder Social logo

Crash if no audio system found about pyxel HOT 6 CLOSED

kitao avatar kitao commented on May 5, 2024
Crash if no audio system found

from pyxel.

Comments (6)

kitao avatar kitao commented on May 5, 2024

Pyxel uses the sounddevice (https://github.com/spatialaudio/python-sounddevice/tree/0.3.11), the Python wrapper of PortAudio. It seems that there's no way to detect the audio card is active or not in the soudedevice APIs (am I right?), so I need to change the soundedevice or detect it before using it.

I'll investigate.

from pyxel.

Godzil avatar Godzil commented on May 5, 2024

Well at least you could try/catch in audioplayer.py when the call to OutputStream is made to catch the error.

Maybe no the most clean way, but would at least prevent the crash and stackdump.

(I know that I should install the audio driver, but that PC has proved to be painful on that point)

from pyxel.

kitao avatar kitao commented on May 5, 2024

Exactly! I overlooked sounddevice raised exception. I'll catch it.

from pyxel.

Godzil avatar Godzil commented on May 5, 2024

I've seen that there is this function though:

http://python-sounddevice.readthedocs.io/en/0.3.11/#sounddevice.query_devices

Not necessarily useful here, but if you want to allow at some point the user to select which audio device to use, that could be an idea!

from pyxel.

kitao avatar kitao commented on May 5, 2024

Thank you for the information!
Though I haven't released it as python package for PyPI not yet, I fixed it in the master branch.

from pyxel.

kitao avatar kitao commented on May 5, 2024

This bug is fixed in 0.7.3.
Please let me know if it doesn't work.

from pyxel.

Related Issues (20)

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.