Пример #1
0
		void CreateSound()
		{
			// Sound source needs a node so that it is considered enabled
			node = new Node();
			SoundSource source = node.CreateComponent<SoundSource>();

			soundStream = new BufferedSoundStream();
			// Set format: 44100 Hz, sixteen bit, mono
			soundStream.SetFormat(44100, true, false);

			// Start playback. We don't have data in the stream yet, but the SoundSource will wait until there is data,
			// as the stream is by default in the "don't stop at end" mode
			source.Play(soundStream);
		}