sounddevice module crashes app

124 views
Skip to first unread message

M J

unread,
Nov 21, 2017, 11:39:59 PM11/21/17
to Kivy users support
Hi,

I'm trying to record sound from the built-in mic on an Android tablet and was using the sounddevice which are convenience  functions to play and record NumPy arrays, but the app crashes when importing the module:

11-21 17:50:18.322 21653 21692 I python  : Traceback (most recent call last):
11-21 17:50:18.322 21653 21692 I python  :   File "main.py", line 5, in <module>
11-21 17:50:18.323 21653 21692 I python  :     import sounddevice as sd
11-21 17:50:18.323 21653 21692 I python  :   File "/data/user/0/org.test.myapp/files/app/crystax_python/site-packages/sounddevice.py", line 58, in <module>
11-21 17:50:18.323 21653 21692 I python  :     from _sounddevice import ffi as _ffi
11-21 17:50:18.323 21653 21692 I python  :   File "/data/user/0/org.test.myapp/files/app/crystax_python/site-packages/_sounddevice.py", line 2, in <module>
11-21 17:50:18.324 21653 21692 I python  :     import _cffi_backend
11-21 17:50:18.324 21653 21692 I python  : ImportError: No module named '_cffi_backend'
11-21 17:50:18.356  2879  2888 I art     : Background partial concurrent mark sweep GC freed 104365(9MB) AllocSpace objects, 17(340KB) LOS objects, 25% free, 46MB/62MB, paused 2.994ms total 278.423ms
11-21 17:50:18.365 21653 21692 I python  : Python for android ended.

The problem seems to be the _cffi_backend so I included the module from somewhere and now I get the following error:
11-21 20:30:38.149 29983 30025 I python  :     _lib = _ffi.dlopen(_find_library('portaudio'))
11-21 20:30:38.149 29983 30025 I python  : AttributeError: 'NoneType' object has no attribute 'dlopen'


Is there any way to record audio with Kivy/buildozer ? Maybe not possible yet? My app is very simple: press a button, record 2 seconds of audio, press another button, play it back. I've used sounddevice with python/ttk and the raspberry pi and worked great but now I want to port my app to Android.

Thank you
Reply all
Reply to author
Forward
0 new messages