Enable/Disable background music

Related searches

To enable background music from app Spotify or Music app, I use this code:

do
        {
            try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryAmbient)
            try AVAudioSession.sharedInstance().setActive(true)
        }
        catch let error as NSError
        {
            print(error)
        }

But how can i reverse that, to stop allow background music playing?

According to the documentation, the chief playback audio session categories are:

AVAudioSessionCategoryAmbient

When you use this category, audio from other apps mixes with your audio.

AVAudioSessionCategorySoloAmbient

By default, using this category implies that your app’s audio is nonmixable—activating your session will interrupt any other audio sessions which are also nonmixable.

AVAudioSessionCategoryPlayback

By default, using this category implies that your app’s audio is nonmixable—activating your session will interrupt any other audio sessions which are also nonmixable.

So, you've deliberately picked the only playback category which doesn't silence nonmixable background audio. If you do want to silence nonmixable background audio, pick one of the other categories. There's nothing wrong with changing categories at any time.

How to Turn Off Background Listening (YouTube Music Key , How to Turn Off Background Listening (YouTube Music Key) | SoleilTech. 23,850 views23K Duration: 2:04 Posted: Dec 16, 2014 Enable/Disable background music. Ask Question Asked 3 years, 11 months ago. Active 7 months ago. Viewed 731 times 2. To enable background music from app Spotify or

private func setIsAudioPlaysInBackground(isPlay: Bool) {
    if isPlay {
        try? AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.ambient)
    } else {
        try? AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback)
    }
    try? AVAudioSession.sharedInstance().setActive(true)
}

How to Turn Off PS4 Background Music & Key Tones (Best Method , Go to settings. Scroll down to sound and screen. Under here you will find an option to uncheck Duration: 1:24 Posted: Jul 25, 2019 getting annoying background music through my laptop speakers,even when playing my own stuff,how can i stop it or what is causing it? This thread is locked. You can follow the question or vote as helpful, but you cannot reply to this thread.

Have you tried this code?

AVAudioSession.sharedInstance().setActive(false)

I haven't tested it but from what I assume it would stop the music.

How do I turn off the background music while watching a video on , I need to get rid of the background music as I can't hear what the person on the video is saying, I have a hearing problem and the damn music� In the Sound window, click the Sounds tab. In the Program Events section, locate the sound you'd like to disable or change in the drop-down list under the Sounds

Anyone knows how to turn off the background music on the game , 13.7k members in the SkyGame community. This subreddit is dedicated to Sky: Children of the Light, the latest game by thatgamecompany! It’s really a quick and easy process to disable background music on your PS4: Turn on your PS4. Go to Settings> Sound and screen. Uncheck the box next to System Music to disable it.

How to Disable PS4 Background Music, Here's how to turn off system music on the PS4, giving you a quieter home screen experience. Any programs sound can be adjusted. Thanks for the tip, but for something so obvious is should be in the Oculus UI somewhere. It is, it's in options once you are in home, bring up the settings menu when in your home environment. (left controller) Should be under Audio, you can control background music and SFX volume.

3. Select the 2nd option “Enable/Disable remote command line access to your pi using SSH” 4. Hit enter a couple of times until your back to menu 5. Go down to finish and reboot your RetroPie. If it does not ask you to reboot type in sudo reboot and hit enter to reboot. Install MPG123 0. When RetroPie is booted up hit F4 key to enter command