Mittenchops
Mittenchops

Reputation: 19664

Options for audio input into Kivy?

I saw from here that "Recording audio is not supported" in kivy. Some googling told me that there is some work being done on this, but nothing looked conclusive or settled.

I'm wondering how people work around this, especially for Ubuntu or Android.

If there are other solutions, I'm just plain looking for something that would let me code in python and produce something like a visualizer that runs on android and ubuntu, and allows multi-touch input--whatever modifications I have to make to keep a reasonably centralized codebase across the 2 platforms. Kivy looked like a solution, but this audio problem seem to be hamstringing.

Upvotes: 2

Views: 1705

Answers (1)

Nykakin
Nykakin

Reputation: 8747

Audiostream mentioned in link you've found has an example of reading bytes from microphone. You can find examples of integration with kivy here. For Ubuntu you can try PyAudio. See this example. In your kivy application you can detect system through code like:

from kivy.utils import platform

def do_smth(self):
    p = platform()
    if p == 'android':
        # ... 
    elif p == 'ios':
        # ...
    elif p == 'win':
        # ...
    elif p == 'macosx':
        # ...
    else
        # linux

It looks like you need to handle sound input separately but you can have rest of the code common for both platforms.

Upvotes: 2

Related Questions