I want to get the speaker volume and mute switch value of the smartphone terminal from Unity.

Asked 1 years ago, Updated 1 years ago, 39 views

We use Unity 4.6 to develop apps for iOS and Android.
Sound audioSource.Play() and
Wait while yield return new WaitForSeconds (1.0f); rings.


when the volume of the terminal speaker is zero or when the mute switch is turned on in iOS I'd like to proceed without making a sound (no waiting), but
Is there a way to access the speakers from the Unity script?
(You only need to 」get や the volume or switch, and you don't have to change it.)
Also, can a native plug-in handle it?

As a result of the investigation, the volume of the microphone was acquired, but I couldn't find the information on the speakers, so I asked you a question.
If anyone knows anything, I would appreciate it if you could let me know.

android ios unity3d

2022-09-30 14:12

1 Answers

I've never done it before, so I might be wrong, but I think there is an AudioListener.

https://stackoverflow.com/questions/30859693/how-do-i-mute-the-audio-in-unity-3d

AudioListener.volume=0;

You can set the .volume to zero, so you may be able to determine .volume==0.


2022-09-30 14:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.