aidlearning / AidLearning-FrameWork

🔥🔥🔥AidLearning is a powerful AIOT development platform, AidLearning builds a linux env supporting GUI, deep learning and visual IDE on Android...Now Aid supports CPU+GPU+NPU for inference with high performance acceleration...Linux on Android or HarmonyOS
https://docs.aidlux.com
Other
5.55k stars 704 forks source link

how to play sound in adilearning by command in terminal window? #186

Open leechaowen opened 2 years ago

leechaowen commented 2 years ago

how to play sound in adilearning by command ? i had installed the packages termux-api in python to call the termux.Media.play function , no help. and try to install mpv, no helpful too. but , it could helpful in termux . run command to play sound in termux by mpv or termux-api,it's helpful.

my phone is Readmi K40, android 11.

pip install termux-api apt-get install mpv

aidlearning commented 2 years ago

you can using python code like this: import android droid=android.Android() droid.mediaPlay('/sdcard/Download/1.mp3', 'beep', True) (make sure the file 1.mp3 is in the sdcard... ^_^)

aidlearning commented 2 years ago

using android module,Functions like mediaPlay, mediaPlayPause, mediaPlayClose, mediaPlaySeek,mediaPlayStart and mediaPlaySetLooping are used to control the media player.