Search Unity

SOUND VOLUME OF MUSIC PLAYING ON THE DEVICE GETS QUIET AFTER LAUNCHING A UNITY APP

Discussion in 'Audio & Video' started by TimberX, Nov 10, 2016.

  1. TimberX

    TimberX

    Joined:
    Jul 20, 2016
    Posts:
    11
    Hi guys,
    I am new to Unity. I am working on Unity 5.3.6 now. On iOS I found that the game audio will overlap with other native music app's audio, and whenever the game is running, all the other native audio from other apps their volume get lower. And if multitasking or let the unity game go background, the unity game audio will mute and all the other music players will get back to the normal volume.

    I wish to let the game detect whether if there is any other musics are playing when launch or back from the multitasking, if there is other music app playing, the game will just mute itself, the volume control settings for the player in game will be disabled.

    Could anyone point out that how to let the native app music volume play normally but not getting quieter?
    I saw this solution http://answers.unity3d.com/questions/1234385/how-to-avoid-auto-audio-volume-decrease-on-iphone.html, it works great on iOS10 or higher but it occurs error on iOS 8.2 iPhone5
    ERROR: [0x19faba000] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('aiav') failed with error: '!ini'

    If anyone knows how to detect if other apps are playing music, which would be perfect.
     
    Last edited: Nov 14, 2016
    waken likes this.