Sound recording?

1,011 views
Skip to first unread message

Shane Moon

unread,
Mar 29, 2012, 1:02:55 PM3/29/12
to Kivy users support
Hello,

I'm making an app that will involve some speech recognition
functionality, and I was wondering if Kivy can support audio
recording. If it doesn't support natively, is there any workaround?
What would happen if I use a third-party module such as PyAudio -as
in, if I create a package for Android with it, would the app still
work?

Thank you!
Shane

Mathieu Virbel

unread,
Mar 29, 2012, 1:22:20 PM3/29/12
to kivy-...@googlegroups.com
Hi,

Kivy doenst support audio recording at all. If you use third-party, then
you need to be sure it would work on all platforms you're targeting.

Since python on android is still "new", you might have difficulties to
do it:
- check or work on pyaudio for supporting android platform
- check gstreamer for android, but from what i seen, audio can be only
played
(http://cgit.freedesktop.org/gstreamer/gst-android/tree/sink/audioflingersink/gstaudioflingersink.c)
- enhance our android support to wrote the missing part using Android
Java API + JNI + cython extension.

Python world need a real crossplatorm audio library!

Carsten Thielepape

unread,
May 2, 2013, 4:03:29 PM5/2/13
to kivy-...@googlegroups.com
If you made pogress, please let me know.. :-)

I would be intersted in it as wll.

Joel

unread,
May 2, 2013, 4:10:16 PM5/2/13
to kivy-...@googlegroups.com
There's an AudioInput object here:

I don't know how to use it though.

hogana...@gmail.com

unread,
Nov 3, 2013, 1:24:00 PM11/3/13
to kivy-...@googlegroups.com
I would be very interested in seeing developments on this.  Audio recording opens up a lot, especially with Android support.

Hedgehog

unread,
Nov 12, 2013, 6:22:46 AM11/12/13
to kivy-...@googlegroups.com
I'm also really interested in this topic.
Languagesen>it YahooCEerror
very

Nim4n

unread,
Nov 19, 2013, 1:13:12 AM11/19/13
to kivy-...@googlegroups.com
I see this post in stackoverflow:
http://stackoverflow.com/questions/19756680/options-for-audio-input-into-kivy

Is it work on android ?

from audiostream import get_input

# declare a callback where we'll receive the data
def callback_mic(data):
    print 'i got', len(data)

# get the microphone (or from another source if available)
mic = get_input(callback=callback_mic)
mic.start()
sleep(5)
mic.stop()

Mathieu Virbel

unread,
Nov 24, 2013, 1:40:49 PM11/24/13
to kivy-...@googlegroups.com

Yes, audiostream supporting microphone and speaker access on ios and Android. This example should work, with the appropriate permission as RECORD_AUDIO.

Please note that audiostream doesn't handle any compression, you have to do it yourself. The easiest way would be to save it as a wave.

Good luck!

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thy Clouds

unread,
Mar 19, 2015, 4:55:25 PM3/19/15
to kivy-...@googlegroups.com
Hi Mathieu,

I tried recording on Android using a small sample script under Kivy Launcher 1.8.0.0, however it crashes, I don't get error message as to the reason, neither there's info in .kivy/logs/kivy_date.txt file.
I did check the Launcher's permissions and they are Storage, Network communication, Bluetooth, System tools.
I also checked the perms on the stock Voice Recorder app and it has an explicit Microphone permission. 
So this is it, right? No permissions? Basically I'll have to build an APK and provide it with the right perms for this to work?

Thanks!
Roman
Reply all
Reply to author
Forward
0 new messages