Questions tagged [android-audiomanager]

AudioManager provides access to volume and ringer mode control.

AudioManager provides access to volume and ringer mode control.

AudioManager Class Reference

792 questions
0
votes
1 answer

Is it possible to play a tone via the Ear Speaker with Headphone in?

I am making an android app for testing phones and I need to be able to play a tone via the earphone speaker while headphones are plugged in. I am able to get the tone to play via the ear speaker when the headphones are not plugged in, but not when…
Toby
  • 141
  • 3
  • 12
0
votes
1 answer

How Can I Save an mp3 recording in one Applicaton and Play Back Recording in Another Acitiviy

I want to save a recording made in the first activity and then play back the recording in the second activity in my Android App. I think I have everything but I cant seem to find a way to save in the first activity and then be able to access it in…
Toby
  • 141
  • 3
  • 12
0
votes
1 answer

Record and Save Audio in One Activity and Play back Audio in Another Activity

In my App with many activities, I am trying to make a recording in one activity and store it in the phone files. Then in another activity, I want to play that file back. I think I may have a problem with with how I am saving the original file…
0
votes
1 answer

App won't play audio file

I am trying to make an app that plays the audio fie saved in the raw file. I need the app to be play the tone through the music speaker, and then to be able to play through the earpiece. Right now it does not play anything and I can't figure out…
Toby
  • 141
  • 3
  • 12
0
votes
1 answer

Android N: checking for DND state changed before updating checkbox preference

My app sets the ringer mode to silent but with Android N I get a java.lang.SecurityException: Not allowed to change Do Not Disturb state. I followed the steps from this post and the following code will open an activity which contains a toggle button…
0
votes
1 answer

AudioManager Declaration Crashes Android App

Greetings, I'm having a bit of trouble with an Android app that I'm working on (mostly for practice and learning purposes) that uses the AudioManager object. When defining the AudioManager as follows, however, the app crashes when I run…
dwat
  • 312
  • 2
  • 6
  • 14
0
votes
1 answer

query mediastore for newly added files and recently changed ones

I am making a music player app in android.When app starts ,I query all the songs in mediastore ,and show them in list.I also have options to edit information and deleting them from phone.I want to refresh my list .What are some ways to refresh…
0
votes
1 answer

how long the volume up/down buttons have been pressed

I'm trying to figure out how long the volume up and volume down buttons are pressed, but so far, all I've found is this answer here: Android - Getting volume button long clicks I can't find anything less abstract than this so I have no idea how to…
0
votes
1 answer

VideoView stops other apps' music in the background

I have a VideoView without any audio playing every time I start my app. I have noticed that when it starts playing, music playing from other apps in the background pauses. Is there any solution to this? Thank you!
Dale Julian
  • 1,560
  • 18
  • 35
0
votes
2 answers

Vibrate is not working when Screen Locked Mode in Android

I wan to start Vibrate When Locked Screen. My Screen is open/working when wake lock. My Question is that Vibrate is not working when Screen Locked Mode. if Device Locked is open then working. onCreate() KeyguardManager myKM = (KeyguardManager)…
0
votes
1 answer

Vibrate settings in froyo

I read that in froyo if you change vibrate settings with setVibrateSettings() it doesn't sync with SO vibrate settings. Then I found this workaround that people use with some of the functions in this…
0
votes
1 answer

Play sound either from external or internal speaker programmatically

Suppose I have a MediaPlayer class object which is playing some music. Now I want to change the music to play either from device's internal speaker or already plugged in earphone. Let's say just by tapping a button. Is that possible?
Nabin
  • 11,216
  • 8
  • 63
  • 98
0
votes
1 answer

How to check if sound should be ducked?

When we loose audio focus due to AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK we should reduce sound volume, untile audiofocus will be restored to AudioManager.AUDIOFOCUS_GAIN. However, it is fired if we registered listener before event. How to…
Yarh
  • 4,459
  • 5
  • 45
  • 95
0
votes
1 answer

Accesing the microphone in Android to do my own recording

I would like to be able to access the microphone in Android and write the data/buffer from it directly (live). Is there any library for that? So for instance right now I have the code below, but that's a closed system. i.e. The data is recorded…
0
votes
0 answers

Raise volume progressively in Android app

I've got an app where Ii want to sound the alarm ringtone and raise the volume each second. audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); player = MediaPlayer.create(getApplicationContext(),…
Jon Zangitu
  • 957
  • 1
  • 15
  • 30