Git Product home page Git Product logo

Comments (6)

tgarc avatar tgarc commented on July 28, 2024

I was trying to look at this but I quickly realized that sounddevice isn't actually a compiled extension which makes it more difficult to debug C issues like this. Is it much more troublesome to make it into a compiled extension?

from python-sounddevice.

mgeier avatar mgeier commented on July 28, 2024

I'm not sure if I understand ...

It would be reasonably simple to switch from CFFI's ABI mode to API mode, see http://cffi.readthedocs.io/en/latest/cdef.html.
This would change hardly anything in the implementation, most notably, the callback would still be implemented in Python.

If by "compiled extension" you mean manually writing C code using the Python C API, this would be an insane amount of work. Also, PyAudio already does that: https://people.csail.mit.edu/hubert/pyaudio/.
In this case, the callback would still be written in Python.

If you mean to keep CFFI (in API mode) but implement the callback in C, that's what I'm doing in https://github.com/mgeier/python-rtmixer/.

Finally, if you are talking about using the Python C API and implementing the callback in C, that's what pyo does: https://github.com/belangeo/pyo.

from python-sounddevice.

tgarc avatar tgarc commented on July 28, 2024

Sorry about the vagueness, I actually just meant using CFFI in API mode. All this would do is produce some debuggable C code.

from python-sounddevice.

mgeier avatar mgeier commented on July 28, 2024

OK. It should be straightforward, but I haven't actually tried it.

Do you want me to make a branch for API mode?

from python-sounddevice.

tgarc avatar tgarc commented on July 28, 2024

from python-sounddevice.

mgeier avatar mgeier commented on July 28, 2024

Fixed by #75.

from python-sounddevice.

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.