Questions tagged [android-audiomanager]

AudioManager provides access to volume and ringer mode control.

android-audiomanager
Filter by
Sorted by
Tagged with
1 vote
1 answer
213 views

Android detect unsuccessful phone call and try again later

Is there a way to retry a missed or unsuccessful outbound phone call after a period of time? I am initiating a phone call using the ACTION_CALL intent and have it connected to a PhoneStateListener. ...
Tom's user avatar
  • 777
0 votes
1 answer
2k views

How to add two classes in supertype list, PhoneStateListener and AppCompatActivity [closed]

Is it possible to add PhoneStateListener() with AppCompatActivity()? The idea is to create a Phone Call Listener class similar to class CallListener : AppCompatActivity(), PhoneStateListener() {}. ...
Tom's user avatar
  • 777
0 votes
1 answer
563 views

Android - How to create a PhoneStateListener

I have a function to initiate an outbound phone call. I need to set up the listener to know the state of the call (ringing, hang-up, etc). I am having trouble figuring out how to do that and haven't ...
Tom's user avatar
  • 777
0 votes
0 answers
978 views

Android TelephonyManager listener for phone call state

I'd like to setup a listener for when my app initiates a phone call. I need to know the state of the call so that I can enable speaker phone with, I believe, AudioManager. I am not sure how to create ...
Tom's user avatar
  • 777
1 vote
1 answer
1k views

Android "Permission Failure"

I'm working on a system level app for Android (minSdk=20, targetSdk=22). I need to grant the android.permission.MODIFY_AUDIO_ROUTING permission, which I add to my manifest. However, at runtime I get ...
EntangledLoops's user avatar
1 vote
1 answer
456 views

AudioManager getDevices before API 23

As of Android API 23, there exists AudioManager.getDevices() which can be used to obtain information about various hardware devices. I'm building an app that targets API 22 and need a way to figure ...
EntangledLoops's user avatar
2 votes
1 answer
747 views

What does getStreamVolumedB in Android AudioManager return?

I have been trying to get some sort of db SPL conversion for the output volume coming from the android device. I know it is pretty much impossible for it to be a perfect db SPL level because of ...
Natalie Hong's user avatar
2 votes
0 answers
386 views

How to put external audio or video file in emulator android studio?

I am a beginner android app developer. and right now I am developing an android app that can fetch all the audio files from the phone and play them, but my actual phone is malfunctioning and due to ...
Arun Aditya's user avatar
1 vote
0 answers
199 views

AudioRecord: start() status -38 in cordova android application only in Samsung s8 device

I am building a video conferencing application in Cordova android based on webRTC. I am using a plugin "phonegap-plugin-media-stream" for getUserMedia. Audio is working on all devices except Samsung ...
Shashank Gupta's user avatar
0 votes
1 answer
2k views

Android Audio Focus Listener not working in service

I have Play tone service in which i have to wait for audio focus to play a tone. Below is code which i have implemented : import android.app.Service; import android.content.Context; import android....
Feroz Siddiqui's user avatar
1 vote
0 answers
157 views

How to check if music/movie/game is playing in the foreground?

I'm trying to identify what is the current audio usage for. I need to know if it is for music, movie, or game. So far, this is how I'm trying to get the information from the AudioAttribute class but ...
Adriana's user avatar
  • 11
1 vote
0 answers
552 views

Android audio player not play like whatsApp audio player

when i am play audio player and between playing i am play second audio first audio progress bar and timer sink with second audio player and so on . please help on this .**All audio are loaded in ...
Rao Jilani's user avatar
1 vote
1 answer
271 views

Is there any way to choose a specific microphone as AudioSource for Audio recording with the help of MicrophoneInfo?

I'm working on an app that will diagnose each microphone available in the device. I'm able to get all microphone info using MicroPhoneInfo. How to pass each microphone as an audio source for the ...
Azay Gupta's user avatar
0 votes
0 answers
170 views

how to programmatically increase/decrease volume using speech in Android

The goal here is to say "volume up" and for the volume to increase by 20% at a time by speaking that command for media playback. Not just to set it to max volume when the app starts. and conversely ...
EntryLevDev's user avatar
0 votes
0 answers
206 views

Unable to turn on speaker phone in call Android

I am developing a Phone application I want to turn speaker ON/OFF in call. I want to enable and disable the speaker with a button click and I am using the following code. I tried different methods to ...
G. Vijay Raghva Reddy's user avatar
19 votes
0 answers
3k views

How to reliably fetch and detect changes to the active audio route on Android?

I have a feature where I need to fetch current AND detect switch of the active audio output device of the system. Something like: run app -> fetch current device (which might be embedded speakers) ...
getacoafeza's user avatar
0 votes
1 answer
315 views

How to get audioFocus on Current application?

There are two different Media application with media browser service One is system application and another one is normal application. What happens here system application is taking audio focus when ...
Mohan Chandrasekar's user avatar
7 votes
0 answers
2k views

Android: How to play Gapless audio loop in MediaPlayer?

I know this question asked multiple times in this platform but none of them are solving my issue. I was trying to play a sound file in a loop but when a loop is complete first time there is a ...
Vishal G. Gohel's user avatar
1 vote
0 answers
198 views

Check is vibration with ring mode enabled in Android

Trying to detect vibration and ringing simultaneously using the code not its not working. Settings.System.VIBRATE_WHEN_RINGING is not working and always returning 0. AudioManager am = (AudioManager) ...
Tazeem Siddiqui's user avatar
0 votes
1 answer
378 views

AudioManger FLAG_SHOW_UI not showing the system volume menu in Samsung devices

AudioManager ad = (AudioManager) getSystemService(AUDIO_SERVICE); if (ad != null) { ad.adjustVolume(AudioManager.STREAM_MUSIC,AudioManager.FLAG_SHOW_UI); } This code doesn't showing ...
Nabeel's user avatar
  • 21
1 vote
0 answers
598 views

Prevent bluetooth sco in android to be torn down when VOIP call ends

I am trying to keep the bluetooth sco connected for a device running android from the time the bluetooth headset is connected to when the headset is disconnected or more specifically I would like the ...
Hemang Patel's user avatar
2 votes
0 answers
33 views

Normal Phone Call with Headset plugged possible?

I'm facing a Problem, related to my Question: Is it possible to ignore plugged in Headset and still use phone speakers? I used the same code as in the linked question. The only change here is that I ...
Michael's user avatar
  • 91
1 vote
1 answer
682 views

Can I get the audioStream of other apps

I want to analyse the audio spectrum of my music player app for my bluetooth-Led project. But as far as I understood this article: https://developer.android.com/reference/android/media/MediaRecorder....
milkchocolate's user avatar
0 votes
1 answer
44 views

can an android application play both music and navigation promt in same time?

I'm trying to implement an app which continuously receives audio data and play it using AudioTrack. My app receives media data and navigation prompts at the same time. can these audios play together ...
Sathi Reddy's user avatar
1 vote
1 answer
389 views

How to pause Media Player of a specific app?

I need to pause a player of a specific application - for example Spotify. But if some other player plays I would like to keep it playing and only pause the Spotify. Is there any function how I can do ...
Petr Kott's user avatar
  • 111
0 votes
1 answer
996 views

Is it possible to ignore plugged in Headset and still use phone speakers?

I would like to use the Phone Speakers while a Headset is plugged-in, instead of the Headset-Speakers. Is it possible to do that? if yes, how can I achieve it? I'm developing an App in Java for ...
Michael's user avatar
  • 91
0 votes
0 answers
223 views

Play video without gaining the system audio focus (only play video and no audio) and without stoping the background music

I want to play background music when my app plays video but without audio that is the requirement.
Sushil Dubey's user avatar
1 vote
0 answers
170 views

Audio Manager Bluetooth not working properly on Samsung S9, Note8

This is the code of I have to handle the audio: fun setSpeakerValue(value: SIPManager.AUDIO) { speaker = value when (value) { SIPManager.AUDIO.EAR_PIECE -> { ...
rosu alin's user avatar
  • 5,780
3 votes
1 answer
3k views

Is there any way to fetch the info of the current playing song?

I am developing an app that mirrors the player state of third party player apps for studying reasons. I managed to get to know how to control the other players playback state through the AudioManager ...
Augusto Carmo's user avatar
1 vote
0 answers
149 views

How to detach audio stream bitrate from video file in Android?

I want to get audio bitrate from video file and save it. Is it possible to get audio track bitrate alone form video file using ffmpeg ? if possible then how to do it?...Any suggestion will be ...
Vinal Lathiya's user avatar
2 votes
1 answer
7k views

How to request AudioFocus for android devices above api level 20?

I implemented the call using AudioManager class as mention in this doc : https://developer.android.com/guide/topics/media-apps/audio-focus. I can see the audio manager resource get held when I call : ...
Sumit T's user avatar
  • 1,313
0 votes
1 answer
241 views

Media player stops working after playing some files

I have an Android app and I want to play different sounds. My code works fine but after playing some sounds it stops playing more sounds. My click listener is in a ListView, So it loops for different ...
Saeid's user avatar
  • 448
1 vote
1 answer
2k views

Android - Get max safe stream volume

I have a use case to change stream volume programmatically, but on newer android volume, raising the volume above a certain limit (60% as per my observations which corresponds to step 9 on most phones)...
Menna Mostafa's user avatar
3 votes
0 answers
244 views

Is is possible to have more than one AudioFocus in one app on Android?

I'm developing an android app which will play both audio file(via MediaPlayer), and TextToSpeech. Each will have specific timing for playing. While audio is playing, if TTS speaking time comes, I want ...
Choael Ko's user avatar
0 votes
1 answer
1k views

AudiManager changing from Bluetooth to EAR_PIECE does not work

I have a button that should go from EARPIECE to SPEAKER to BLUETOOTH and so on. This is my code: fun setSpeakerValue(value: SIPManager.AUDIO) { speaker = value when (value) { ...
rosu alin's user avatar
  • 5,780
0 votes
1 answer
543 views

Android - API to check which device, wired headset or USB headset, is playing audio if both are connected

I have a problem detecting which device, wired headset or USB headset is playing audio when both of them are connected to an Android device. Is there an API which will allow checking that? I have ...
Jacik's user avatar
  • 1
18 votes
4 answers
5k views

Enable Silent Mode in android without triggering Do Not Disturb

Having a little trouble bending my head around this one. In my volume control app I am trying to set the system sound profile to SILENT ONLY without triggering do not disturb, my app has access to ...
Lee Bailey - LeeDrOiD's user avatar
1 vote
0 answers
53 views

How to increase the media volume in andriod studio?

The idea behind this code is to find your misplaced phone. This can be achieved by just sending a text message to your phone through another phone. This text message sent should contain the term "RING"...
Shreya Yaganti's user avatar
2 votes
0 answers
78 views

Cannot detect vibrate mode while DND on

I am trying to figure out if the user has vibrate mode on. Usually... audioManager.getRingerMode() ...returns AudioManager.RINGER_MODE_VIBRATE. However when Do Not Disturb (DND) is on, ...
Flyview's user avatar
  • 1,901
4 votes
0 answers
121 views

How to differentiate if a call is a mobile or an IP call?

I'm working on a telephony app and I need to check if a call is mobile or IP. It doesn't matter if this check is done on incoming calls or on active calls. I'm testing the IP calls with WhatsApp and ...
Monica Ivan's user avatar
2 votes
0 answers
683 views

Alternatives to depreciated "setWiredHeadsetOn" to control microphone input

I am working on an app that will switch off or ignore the internal microphone in preference for the headset microphone. I found an app that does something similar (Lesser AudioSwitch) and it works ...
PublicStringName's user avatar
0 votes
2 answers
7k views

Receiving 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference

I am new to android development and scripting with java. I am trying to create an app that allows me to toggle the internal microphone on and off via a switch. I found two scirpts (a switch script and ...
PublicStringName's user avatar
0 votes
1 answer
489 views

In java, the is the stream type when using the audioManager. (like STREAM_MUSIC) what does the stream type mean?

I have no idea what the stream type in java music manager is, I looked all over the internet but found no answer... what does it mean and what other types of stream are there?
nerya's user avatar
  • 41
1 vote
0 answers
598 views

How to mute YouTube video and don't interrupt music playing with audio focus handling?

I'm trying to use android-youtube-player library (https://github.com/PierfrancescoSoffritti/android-youtube-player) to play YouTube videos, which I want to mute when no headphones are on or when user'...
Daniel's user avatar
  • 337
0 votes
1 answer
300 views

How to check Audio Stream supported or Not?

Hi i am building a app which uses STREAM_ALARM. There are some devices which does not support STREAM_ALARM (i think). As a result of this, my app is not playing music in these devices. In above ...
Faiizii Awan's user avatar
  • 1,690
1 vote
0 answers
148 views

why AudioManager.setMode(MODE_IN_COMMUNICATION) interrupted background music for almost 2 seconds?

in my android app, I had to set MODE_IN_COMMUNICATION to AudioManager while playing background music(.mp3), but as soon as I invoke setMode(MODE_IN_COMMUNICATION), the background music was interrupted ...
everlastxc's user avatar
2 votes
2 answers
112 views

How can i add music settings for my app?? Like Android games

I have tried android audio manager but it turns off the whole system sound. Here is my code: if (VolIsMute) { manager.setStreamMute(AudioManager.STREAM_MUSIC, false); VolIsMute = false; } ...
Muktadir Soyeb's user avatar
1 vote
1 answer
56 views

Music settings for a specific app,How to do this?

I am using AudioManager but when i turn off the sound it turn off the whole system sound,if there any way to turn off sound to a specific app only. I have tried this code if (VolIsMute) { ...
Muktadir Soyeb's user avatar
0 votes
1 answer
969 views

Show progress bar while loading audio file

I am fairly new to android development, so what I am trying to make is an app that can play audio from url, I want to show progress bar while the audio file is loading from the web(some audio files ...
Karan Chunara's user avatar
0 votes
1 answer
45 views

How to mute only incoming calls ring and not mute the sms messages

how to mute only incoming calls ring and not sms messages and oppesite-mute only sms messages i tried to use audioManager.setStreamVolume() like audioManager = (AudioManager)this.getSystemService(...
israel genzel's user avatar

1 2
3
4 5
16