I have tried all kinds of apt install software, using Python library to write code to run (all kinds of libraries are not available), using java to write code to run (using Android’s own API), all failed. The reasons all point to one point: there is no default audio.
Analysis: because the execution environment is termux, there is no default setting in termux. Android is the real system of the outer system of termux. As long as the sound card, driver, default device and so on are set in termux, they can also be executed after setting.
Here’s a simpler way:
Premise: tinyalsa, root identity, a 44.1KHz audio, turn on the volume
./tinyalsa play ~/test.wav
./tinyalsa tinypcminfo -D /proc/asound/cards
Set the output device to speaker:
/tinyalsa tinymix 0 SPK
Write the play command into a script, give him permission, you can play and use it freely!
After a variety of searches, a better solution was found:
Better and simpler solutions
- Solve the audio control and report domexception: the play() request was interrupted by a call to pause in the chrome console
- termux Failed to initialize runtime
- Mobile phone code termux
- Adobe audit cannot play solutions
- command/usr/bin/codesign failed with exit code 1- code sign error
- Solutions to the failure of installing jupyters in termux
- Resolve Audio: failed to create voice ` goldfish_ Audio ‘error
- Several ways to check the IP address of raspberry pie
- Python packaged *. Exe is running os.popen (cmd)/ subprocess.Popen *. Exe crashes with invalid [winerror 6] handle
- VIM e667: fsync failed error
- When installing pyaudio, an error is reported: failed error: portaudio. H: there is no such file or directory
- C#: Analysis of the difference between write() and writeline()
- How to convert audio to subtitle (text) with Python?
- AE ram preview requires 2 or more frameworks to solve playback
- Solution to unbalanced load of multiple cards (GPU’s 0 card is too high) in Python model training (simple and effective)
- After installation, Ubuntu encountered [SDB] asking for cache data failed assembling drive cache: write through
- Method of modifying file and folder permission by Chmod command in Linux
- Docker command error during connect: get http://2F2F.2Fpipe2Fdocker_ engine/v1.36/containers/json: open//.
- To solve the problem that fastcgi process often fails recently, an unknown fastcgi error occurs
- Pandas memory error