     "Sounds/Powerup.wav"
 };
 
+SoundSource@ musicSource;
+
 void Start()
 {
     // Execute the common startup for samples
     SampleStart();
+
+    // Create a scene which will not be actually rendered, but is used to hold SoundSource components while they play sounds
+    scene_ = Scene();
+
+    // Create music sound source
+    @musicSource = scene_.CreateComponent("SoundSource");
+    // Set the sound type to music so that master volume control works correctly
+    musicSource.soundType = SOUND_MUSIC;
 
     // Enable OS cursor
     input.mouseVisible = true;

    audio.masterGain[SOUND_MUSIC] = newVolume;
}

void HandleSoundFinished(StringHash eventType, VariantMap& eventData)
{
    Node@ soundNode = eventData["Node"].GetPtr();
    soundNode.Remove();
}

// Create XML patch instructions for screen joystick layout specific to this sample app
String patchInstructions =
        "<patch>" +


    if (sound !is null)
    {
        // Create a SoundSource component for playing the sound. The SoundSource component plays
        // non-positional audio, so its 3D position in the scene does not matter. For positional sounds the
        // SoundSource3D component would be used instead
        SoundSource@ soundSource = scene_.CreateComponent("SoundSource");
        soundSource.autoRemoveMode = REMOVE_COMPONENT;
        soundSource.Play(sound);
        // In case we also play music, set the sound volume below maximum so that we don't clip the output
        soundSource.gain = 0.7f;
    }
}

void HandlePlayMusic(StringHash eventType, VariantMap& eventData)
{
    Sound@ music = cache.GetResource("Sound", "Music/Ninja Gods.ogg");
    // Set the song to loop
    music.looped = true;

    musicSource.Play(music);
}

void HandleStopMusic(StringHash eventType, VariantMap& eventData)
{
    musicSource.Stop();
}

void HandleSoundVolume(StringHash eventType, VariantMap& eventData)
