Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


Get the device volume


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 sheep19   Members   -  Reputation: 413

Like
0Likes
Like

Posted 25 September 2012 - 01:57 PM

I will explain my situation briefly:

Let's say I'm on my android phone and I set the volume to 0 (silent).
Then I start my application. Inside my app, I start playing music (using MediaPlayer).
I don't want the music to start playing - but it does, even though the phone is silenced. I'm not saying that's wrong.

So what I want to do is to "get" the volume of the device (it would have to be 0 or 0.0 in this case) and set it using: audioManager.setStreamVolume().

How can I get that information?

Sponsor:

#2 frob   Moderators   -  Reputation: 22242

Like
0Likes
Like

Posted 25 September 2012 - 02:09 PM

I'd try adjustSuggestedStreamVolume instead.

That will raise and lower the volume by one increment, and it will operate correctly if the device has weird audio streams.

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#3 6677   Members   -  Reputation: 1058

Like
0Likes
Like

Posted 27 September 2012 - 11:51 AM

Just an FYI, android maintains 3 seperate volume levels. Ringer volume (which is what the silent mode refers to), Media volume (which I think is the only one apps can play with directly) and In call volume.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS