title: Control volume of system sound
body: <p>I have the following code for playing a click when a button is tapped.</p>
  
  <pre><code>private var clickSound: SystemSoundID!
  
  clickSound = createSound("ButtonClick2", soundType: "wav")
  
  AudioServicesPlaySystemSound(clickSound)
  </code></pre>
  
  <p>This sound plays at the same level, regardless of the volume on the device and whether the device is muted.</p>
  
  <p>This is really two questions.</p>
  
  <ol>
  <li>How can I detect whether the device is muted?  I want to not play the sound if the device is muted.</li>
  <li>How can I adjust the volume of the sound based on the volume of the device?</li>
  </ol>