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
Play command:
./tinyalsa play ~/test.wav
View command:
/tinyalsa tinymix
./tinyalsa tinypcminfo -D /proc/asound/cards
cat /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
Read More:
- Resolve Audio: failed to create voice ` goldfish_ Audio ‘error
- Easywasmlayer reports an error uncaught (in promise) domexception when playing a video
- An error is reported when starting the Android emulator: Emulator: audio: Failed to create voice `goldfish_audio_in’
- Solutions to the failure of installing jupyters in termux
- Solve the audio control and report domexception: the play() request was interrupted by a call to pause in the chrome console
- Camtasia | An error occurred in the Recorde System Audio setup Failed
- Mobile phone code termux
- termux Failed to initialize runtime
- Termux installing redis
- Conversion of audio file format with ffmpeg command
- Failed to install realtek HD audio driver Code:0xE0000247
- Video player plays flv with error flv: Unsupported audio codec IDX: 7
- How to convert audio to subtitle (text) with Python?
- Extract audio from ffmpeg video to mp3 format or m4a format command
- Solve the problem of Python in Windows environment: Fatal error in launcher: Unable to create process using’”‘ in pip installation
- In Linux shell script, about the commonly used flag [- EQ, GT..] in test and if judgment
- Error in running script in openwrt
- Analysis of [error code [942], ora-00942 in synchronization of DDL statements in ogg
- Error in installing centos8.3: DFN error: error in postrans scriptlet in RPM package kernel core
- Problems and solutions of error reporting in using swiper in Vue