Open VladKolerts opened 2 weeks ago
Install https://f-droid.org/packages/com.termux.api/
Grant microphone permission to Termux:API app in device settings.
Try to load module sles source.
Install https://f-droid.org/packages/com.termux.api/
Grant microphone permission to Termux:API app in device settings.
Try to load module sles source.
Already done. You can see this steps at "What steps will reproduce the bug?" Without this, sox's rec and play will also not work.
Isn't portaudio using ALSA?
ALSA does not work on Termux.
Isn't portaudio using ALSA?
ALSA does not work on Termux.
no, ALSA don't installed. I describe the entire installation process in the block "What steps will reproduce the bug?"
Sound works in termux command line. My problem is sound devices are not visible from Python
no, ALSA don't installed
That's not what I meant.
Sound works in termux command line.
Because command line tools made to work with Pulseaudio only. They won't attempt to query devices using ALSA.
My problem is sound devices are not visible from Python
Check what audio backend used by your libraries, especially portaudio which is a dependency for sounddevice
and normally uses ALSA.
The issue you have is not a bug but a misconfiguration on your side.
Basically everything that does not use Pulseaudio or native OpenSLES won't be able to work with sound.
Problem description
Sox's
rec
andplay
working good, but from python modules can`t access to devices. I'm attempt to use sounddevice and pyaudio. Devices list is empty.What steps will reproduce the bug?
pkg update pkg upgrade pkg i termux-api
pkg i termux-api
pkg i portaudio(19.07.00-1)
pkg i pulseaudio(17.0-1)
pkg i sox(14.4.2-25)
pkg i python(3.11.9-2)
pip -Vpip 24.0 from /data/data/com.termux/files/usr/lib/python3.11/site-packages/pip (python 3.11
pip install --upgrade setuptools wheelsetuptools-70.0.0-py3-none-any.whl
wheel-0.43.0-py3-none-any.whl
pip install sounddevice pyaudio
sounddevice-0.4.7-py3-none-any.whl
PyAudio-0.2.14.tar.gz
pip list<restarting termux>
pulsesound --start pactl load-module module-sles-source17
pactl list sources shortrec 'test.wav'
play 'test.wav'
<voice recorded and played>
python
What is the expected behavior?
No response
System information
tried at two device (android 9 and 13), termux 0.118: