Question

I hear about this sound program that supposedly comes with Android called "stagefright" that is needed in order to play audio files from the command-line of a terminal emulator. One source from which I heard of it is here: How do I use Stagefright from the command line?

Problem is --- I checked pretty well for it on my Android device (Aesus Nexus 7) and it isn't there. (Either there is no "stagefright" or it's command-line interface program is missing.) How can I get it installed --- and if I can't, is there anything else I could install that would allow me to play audio files from the terminal-emulator command line?

I ask this because my inability to play audio files from the command-line is a serious limitation.

Was it helpful?

Solution

As android generally reserves direct audio access permission to system processes acting as delegates for applications through Android app-only APIs, a stagefright executable would not be something you could add to a secured device if it was not placed there by the system vendor. However, you can accomplish your need to play audio upon request from the adb command line by using an Intent.

Here's an example - adjust to your specifics:

am start -a android.intent.action.VIEW -d file:///mnt/sdcard/ringtones/hangouts_video_call.ogg -t audio/ogg

Remember to change that to audio/mp3 if that is your file type

This utilizes the default player - if doesn't give precisely the behavior you want, you may need to make your own custom player app with that behavior, and then use an Intent (with an explicit package name) to trigger it from the command line.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top