Exemple #1
0
        /// <summary>
        /// Sets the sound (read from a file) that will be used.
        /// </summary>
        /// <param name="soundFile">Soundfile relative to current directory. Must be in OGG format.</param>
        /// <param name="loop">Whether the sound should loop</param>
        /// <param name="streaming">Whether the sound should be streamed from the disk (true) or read into the RAM and then played (false).</param>
        public void SetSound(string soundFile, bool loop, bool streaming)
        {
            if (System.IO.File.Exists(soundFile) == false)
            {
                throw new System.IO.FileNotFoundException("The sound file : " + soundFile + " does not exist.");
            }
            if (streaming)
            {
                _sound = FreeSL.fslStreamSound(soundFile);
            }
            else
            {
                _sound = FreeSL.fslLoadSound(soundFile);
            }

            LoopSound(loop);
            _withSound = true;
        }