Affiliate Disclosure
If you buy through our links, we may get a commission. Read our ethics policy.

These preinstalled apps can turn your iPhone into a bedtime sound machine

Apple Music has many curated albums meant to be played at bedtime

Your iPhone has a built-in sleep timer for media playback that can be used with Apple Music and Shortcuts automation to build the perfect bedtime noise machine. Here's how to set it up.

If you've ever used third-party apps like Dark Noise or other noise machines, a popular feature is the sleep timer. Users may want to stop streaming media from playing after a specific interval, just like setting a sleep timer for a TV, so it doesn't play infomercials all night.

Anyone who uses ambient noise, music, or ocean sounds to fall asleep may not want those sounds playing all night. You can accomplish this by setting up a sleep timer, but as some may have discovered already, there's no obvious sleep option in Apple Music.

Apple has hidden an option to stop media playback within the Clock app. We've also discovered this ability can be automated using Shortcuts so that you can create automated sleep timers.

How to manually set a sleep timer for Apple Music (and other media on iOS):

Ensure the Timer is set to 'Stop Playing' and your iPhone is the audio source
Ensure the Timer is set to 'Stop Playing' and your iPhone is the audio source
  1. Open the Clock App.
  2. Select "Timer" at the bottom right.
  3. Set the desired duration.
  4. Tap the "When timer ends" block.
  5. Scroll all the way down.
  6. Select "Stop Playing".
  7. Tap "Start" to begin the sleep timer.

If performed correctly, any audio playing directly from your iPhone will stop playing at the end of the timer. No alarm will sound, and the user will not have to take action.

We use this for Apple Music in our example, but it works for any media, as long as it is sourced from your device. That means you cannot use this feature for HomePod mini or Apple TV if those devices are playing their own audio.

This gets tricky with AirPlay 2 since source devices can use Handoff to make HomePod into their own audio source. If you want the sleep timer to work, it must be set on the device sourcing the audio. To avoid this issue, use Bluetooth speakers or AirPlay 2 non-HomePod speakers for playing bedtime audio.

If you want to use the HomePod for bedtime audio, the same sleep timer trick can be performed, but it must be done on the device. Simply tell Siri on that HomePod to "set a sleep timer for one hour" to stop audio from playing in an hour.

Automation tools make this all much simpler, and iOS has one built-in that's easy to use called Shortcuts.

Automating sleep sounds using Shortcuts on iOS

We're approaching these examples for setting up a bedtime sound machine, but you can set up shortcuts for sleep-timed music for anything. For instance, you could create a Shortcut that plays music for exactly one hour from your favorite playlist every time it is pressed.

First, you should build a Shortcut with the actions needed to play your desired playlist and set a timer. Then we'll set up the automation using that Shortcut later.

Apple Music sleep timer Shortcut

Use the Apple Music Sleep category to find playlist options for your Shortcut
Use the Apple Music Sleep category to find playlist options for your Shortcut

You can play audio from your iPhone for this automation, but we recommend having at least a cheap Bluetooth speaker or audio system. We've set this automation up using a bedroom Sonos system with AirPlay 2 capabilities.

  1. Open the Shortcuts app and tap the "+" at the top to get started.
  2. Name your Shortcut using the text block at the top.
  3. Search for the term "AirPlay."
  4. Select the "Change Playback Destination" action and change your device to the desired speaker that isn't a HomePod.
  5. Search for the "Set Volume" action and choose a desired volume level.
  6. Search for Apple Music and select the action group.
  7. Select the "Play Music" action then tap the empty "Music" text box.
  8. Pick your favorite playlist or search "Sleep" to find curated sleep playlists made in Apple Music.
  9. We recommend setting the action details to shuffle songs and not repeat tracks.
  10. Finally, search for "Timer" and add the "Start Timer" action.
  11. Set the timer to the desired length.

If set up correctly, the shortcut should look like our image above. If you tap the play button on the shortcut, it will perform the steps in order. You can do this manually each day when you're preparing for bed, but Shortcuts lets you take this one step further.

Automating the Sleep Sounds Shortcut

Run your Sleep Sounds Shortcut at your designated Betime each night
Run your Sleep Sounds Shortcut at your designated Betime each night

This step requires a little more setup but utilizes the built-in systems found across your iPhone for better control. Before creating the automation, you'll need to verify you have a Bedtime in the Health app.

Open the Health app, tap the "Browse" tab, and select "Sleep." Here you can see your sleep schedule and tap "edit" to ensure your Bedtime and Wake Up alarms are correct. Once these are set up, you'll have access to some clever automation tools in Shortcuts.

Here's how to get your Sleep Sounds Shortcut to happen automatically every day at your set Bedtime.

  1. Tap the "Automation" tab in the Shortcuts app.
  2. Tap the "+" at the top and select "Create Personal Automation."
  3. Select "Sleep" then "Bedtime Begins" then "Next."
  4. Tap "Add Action" then search "Run Shortcut."
  5. Add your Sleep Sounds Shortcut to the block.
  6. If you want lights to turn off or other actions to occur at Bedtime, add those actions now.
  7. Tap "Next" then toggle off "Ask Before Running" so the automation occurs without user input.

If set up correctly, your iPhone will connect to your desired speaker, set a specified volume, start playing a playlist from Apple Music, then stop an hour later every day at Bedtime. Add any steps you want to create an even more complex Bedtime automation, like changing your Apple Watch face to a custom face for sleep.

Note that you'll need to make sure the timer in the Clock app has "Stop Playing" selected for this to work. The automation doesn't perform this step for you, so if you use the timer on your iPhone during the day, make sure you've set this back.

Be sure to explore the variety of sleep sounds and ambient noise found in Apple Music. We use the curator "Apple Music Sleep" for this automation.