Open HAKANMAZI opened 3 years ago
Thanks for the report. Unfortunately Android doesn't support any of the standard Linux audio APIs, so I think PyAudio / PortAudio would require a new backend in order to work.
If anyone else needs this package, please click the thumbs-up button above and subscribe to this issue, and we may look into it in the future.
Is there any progress on this subject?
Not yet, sorry.
After three days of searching a solution i came to know that it is not compatible with android studio 🥲 i am a beginner/student i wanted to implement PayAudio in my Final year project.. my request is to please make it possible... I there any alternative i can use with my android app ?
You can use the standard Android audio APIs directly, either in Java, Kotlin, or in Python using the Chaquopy API. For an example, see here.
i think our goal is to convert speech to text real time. so i have an idea, we pass bytes array as agrument of python function, then python function detect and return text to android . Is this solution possible?
Yes, that should be possible. But I don't think we currently support any Python packages which can decode compressed audio, unless there's a pure-Python option I don't know abot. So you'd have to pass the audio as an uncompressed WAV file, or raw PCM.
After 3 years any progress?
chaquopy {
defaultConfig {
version = "3.9"
buildPython("/Users/xxx/.pyenv/versions/3.9.18/bin/python")
pip {
install "tflite_runtime-2.5.0.post1-cp39-cp39-macosx_12_0_arm64.whl"
install "pyaudio"
install "openwakeword"
// https://test.pypi.org/simple/onnxruntime/
install "onnxruntime-1.16.2-cp39-cp39-macosx_11_0_arm64.whl"
}
}
}
android {
defaultConfig {
ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
...
Collecting pyaudio
Using cached PyAudio-0.2.14.tar.gz (47 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
...
ERROR: Command errored out with exit status 1:
command: .../android/app/build/python/env/debug/bin/python .../android/app/build/python/env/debug/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/zd/fmk31xcn1q3b09jlpc14k3g00000gn/T/tmp1g_drf5v
cwd: /private/var/folders/zd/fmk31xcn1q3b09jlpc14k3g00000gn/T/pip-install-sfda6ys4/pyaudio
Complete output (10 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-13.5-arm64-cpython-39
creating build/lib.macosx-13.5-arm64-cpython-39/pyaudio
copying src/pyaudio/__init__.py -> build/lib.macosx-13.5-arm64-cpython-39/pyaudio
running build_ext
building 'pyaudio._portaudio' extension
error: CCompiler.compile: Chaquopy cannot compile native code
----------------------------------------
ERROR: Failed to install pyaudio from https://files.pythonhosted.org/packages/26/1d/8878c7752febb0f6716a7e1a52cb92ac98871c5aa522cba181878091607c/PyAudio-0.2.14.tar.gz#sha256=78dfff3879b4994d1f4fc6485646a57755c6ee3c19647a491f790a0895bd2f87.
For assistance, please raise an issue at https://github.com/chaquo/chaquopy/issues.
Chaquopy: Exit status 1
FAILURE: Build failed with an exception. ...
No, because as I said above, this would require a substantial amount of work on PyAudio's side.
I installed chaquopy on my Android Studio then ı tried to run below code
But I got this error