Make Your iPhone Apps Auto-Play Different Background Sounds for Per-App Ambient Soundscapes « iOS & iPhone :: Gadget Hacks


You can play background sounds in iOS 15 to help you focus, stay calm, or fall asleep, essentially turning your iPhone into a personal sound machine wherever you go. Even better, there’s a way to set each of your apps to play one of Apple’s six ambient soundscapes automatically. When you open the app, its assigned sound plays, then it stops when you exit or switch to another app.

While iOS 15 includes “Per-App Settings,” you won’t find any background sounds in there. Instead, you’ll need to create an automation in Shortcuts. Because there is no “Detect Background Sounds” action in Shortcuts yet, we’ll need to improvise. That means there are multiple ways you can go about it.

Step 1: Create a New Automation

First, open up Shortcuts, tap the “Automation” tab, and hit the blue “Create Personal Automation” button. If you already have one or more automations saved, tap the plus (+) icon in the top right to find the “Create Personal Automation” button.

Step 2: Choose the Apps for the Sound

Select “App” from the list, tap “Choose,” and highlight the app or apps in question. There’s no need to create an automation for each app itself. Instead, you’re making one for each background sound and volume pairing, so select all the apps you want for the sound and volume level you’d like to set up first. You can edit these later to add more apps, subtract apps, or change volume levels.

Hit “Done” when finished checking your apps.

Step 3: Choose the Right Shortcut

Like I said before, there are multiple ways to build a shortcut that plays background sounds when you open an app and stops it when you exit. I’ll give you three options using “Automations” below, as well as one using a regular shortcut, but if you know of a better way, let us know!

Note: when setting “Background Sound,” you have six choices:

  • Balanced Noise
  • Bright Noise
  • Dark Noise
  • Ocean
  • Rain
  • Stream

Option 1: Toggle the Background Sound

The easiest way is to toggle “Background Sounds” on and off whenever the chosen app is opened and closed. It works like a charm, as long as you’re not already playing any background sounds. If you are, when you open the app, it will toggle the sound off, and it will turn on when you exit.

  1. Select both “Is Opened” and “Is Closed” on the New Animation window.
  2. Tap “Next.”
  3. Add “Set Background Sounds” on the Actions window.
  4. Tap “Turn” in that action, and choose “Toggle” instead.
  5. Add another action for “Change Background Sound.”
  6. Tap the current background sound in that action if it’s not the one you want, and choose the one you do want.
  7. Add another action for “Set Background Sounds Volume.” (This is optional.)
  8. Tap the current percentage for “Volume” in that action, and choose the volume level you want.
  9. Add another action for “Set Background Sounds Volume.” (This is optional.)
  10. Tap “Volume” and change it to “Volume When Media Is Playing.”
  11. Tap the current percentage for that, and choose the volume level you want.
  12. Hit “Next” in the top right.
  13. Toggle off “Ask Before Running.”
  14. Hit “Done” to save.

Option 2: Turn the Background Sound On or Off

This way requires two separate automations — one to trigger your background sound when the app opens and another to turn off background sounds when the app closes.

To create the automation that will turn “Background Sounds” on:

  1. Select “Is Opened” on the New Animation window.
  2. Tap “Next.”
  3. Add “Set Background Sounds” on the Actions window.
  4. Make sure the action says “Turn Background Sounds On,” which is the default.
  5. Add another action for “Change Background Sound.”
  6. Tap the current background sound in that action if it’s not the one you want, and choose the one you do want.
  7. Add another action for “Set Background Sounds Volume.” (This is optional.)
  8. Tap the current percentage for “Volume” in that action, and choose the volume level you want.
  9. Add another action for “Set Background Sounds Volume.” (This is optional.)
  10. Tap “Volume” and change it to “Volume When Media Is Playing.”
  11. Tap the current percentage for that, and choose the volume level you want.
  12. Hit “Next” in the top right.
  13. Toggle off “Ask Before Running.”
  14. Hit “Done” to save.

The automation to turn “Background Sounds” off is easier:

  1. Select “Is Closed” on the New Animation window.
  2. Tap “Next.”
  3. Add “Set Background Sounds” on the Actions window.
  4. Tap “On” to switch it “Off” so it says “Turn Background Sounds Off.”
  5. Hit “Next” in the top right.
  6. Toggle off “Ask Before Running.”
  7. Hit “Done” to save.

Option 3: Use Toolbox Pro

With this option, Shortcuts will automatically ask Toolbox Pro, a third-party app, to detect if any audio is playing on your iPhone. When there is no audio playing, it will start up your background sound. There are more downsides to this option:

  • If audio is playing, your background sound won’t start.
  • If “Background Sounds” is already active, you’ll disable it.
  • You’ll need to pay $5.99 to unlock Toolbox Pro’s actions.

In a perfect world, Apple or Toolbox Pro would have an action for “Is Background Sounds Playing” or “Detect Background Sounds.” That would make this so much easier. But it doesn’t, so you can try this option if it makes sense for you. I’m sure there is a better, more complex way to build this so that it behaves closer to what you’d think, so feel free to fool around with it.

  1. Select “Is Opened” and “Is Closed” on the New Animation window.
  2. Tap “Next.”
  3. Add “Is audio playing?” action from Toolbox Pro in the Actions window.
  4. Add an “If” statement.
  5. Tap “Condition” in that, and change it to “is less than.”
  6. Add a “1” in the “Number” field.
  7. Drag-and-drop “Set Background Sounds” from the search to above “Otherwise” in the workflow.
  8. Make sure the action says “Turn Background Sounds On,” which is the default.
  9. Drag-and-drop “Change Background Sound” from the search to above “Otherwise” in the workflow.
  10. Tap the current background sound in that action if it’s not the one you want, and choose the one you do want.
  11. Drag-and-drop “Set Background Sounds Volume” from the search to above “Otherwise” in the workflow. (This is optional.)
  12. Tap the current percentage for “Volume” in that action, and choose the volume level you want.
  13. Drag-and-drop “Set Background Sounds Volume” from the search to above “Otherwise” in the workflow. (This is optional.)
  14. Tap “Volume” and change it to “Volume When Media Is Playing.”
  15. Tap the current percentage for that, and choose the volume level you want.
  16. Hit “Next” in the top right.
  17. Toggle off “Ask Before Running.”
  18. Hit “Done” to save.

Alternative Option: Create a Home Screen Shortcut

This option will only turn on “Background Sounds” to the sound and volume level you want whenever you open the shortcut from your Home Screen or via Siri.

There are multiple downsides. First, it will keep playing the sound when you exit the app. To fix that, you’d need to set up an “off” automation, as seen in Option 2 above. Second, you have to make a shortcut for every app you want to link to a background sound. And third, it will only work from the Home Screen or via Siri.

  1. Ignore Steps 1 –3 above, and go to “My Shortcuts” in the Shortcuts app.
  2. Start a new shortcut.
  3. Give it the name of the app you’re linking to.
  4. Add a custom app icon if you’d like. (This is optional.)
  5. Add the “Open App” action.
  6. Tap “App” on that action, and choose the app in question.
  7. Add “Set Background Sounds.”
  8. Make sure the action says “Turn Background Sounds On,” which is the default.
  9. Add another action for “Change Background Sound.”
  10. Tap the current background sound in that action if it’s not the one you want, and choose the one you do want.
  11. Add another action for “Set Background Sounds Volume.” (This is optional.)
  12. Tap the current percentage for “Volume” in that action, and choose the volume level you want.
  13. Add another action for “Set Background Sounds Volume.” (This is optional.)
  14. Tap “Volume” and change it to “Volume When Media Is Playing.”
  15. Tap the current percentage for that, and choose the volume level you want.
  16. Hit the Settings button in the top right, then “Add to Home Screen,” and “Add.” (You can add a custom app icon now if you didn’t before and do want one.)
  17. Hit “Done,” then the X button in the top right.




Keep Your Connection Secure Without a Monthly Bill. Get a lifetime subscription to VPN Unlimited for all your devices with a one-time purchase from the new Gadget Hacks Shop, and watch Hulu or Netflix without regional restrictions, increase security when browsing on public networks, and more.

Buy Now (80% off) >

Other worthwhile deals to check out:

Cover photo and screenshots by Justin Meyers/Gadget Hacks