Пример #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Fmod Play File Test");

#if DEBUG
#else
            Linsft.FmodSharp.Debug.Level = Linsft.FmodSharp.DebugLevel.Error;
#endif

            var SoundSystem = new Linsft.FmodSharp.SoundSystem.SoundSystem();

            Console.WriteLine("Default Output: {0}", SoundSystem.Output);

            SoundSystem.Init();
            SoundSystem.ReverbProperties = Linsft.FmodSharp.Reverb.Presets.Room;

            if (args.Length > 0)
            {
                foreach (string StringItem in args)
                {
                    Linsft.FmodSharp.Sound.Sound SoundFile;
                    SoundFile = SoundSystem.CreateSound(StringItem);

                    Linsft.FmodSharp.Channel.Channel Chan;
                    Chan = SoundSystem.PlaySound(SoundFile);

                    while (Chan.IsPlaying)
                    {
                        System.Threading.Thread.Sleep(10);
                    }

                    SoundFile.Dispose();
                    Chan.Dispose();
                }
            }
            else
            {
                Console.WriteLine("No File to play.");
            }

            SoundSystem.CloseSystem();
            SoundSystem.Dispose();
        }
Пример #2
0
        public void play()
        {
            if (missing || !render.sound_opt || render.sounds > 6)
            {
                return;
            }


            new System.Threading.Thread(() =>
            {
                try {
#if DEBUG
#else
                    Linsft.FmodSharp.Debug.Level = Linsft.FmodSharp.DebugLevel.Error;
#endif

                    var SoundSystem = new Linsft.FmodSharp.SoundSystem.SoundSystem();
                    SoundSystem.Init(8, Linsft.FmodSharp.SoundSystem.InitFlags.Normal);

                    //SoundSystem.ReverbProperties = Linsft.FmodSharp.Reverb.Presets.Off;

                    Linsft.FmodSharp.Sound.Sound SoundFile;
                    SoundFile = SoundSystem.CreateSound(path, Linsft.FmodSharp.Mode.Hardware);

                    Linsft.FmodSharp.Channel.Channel Chan;
                    Chan = SoundSystem.PlaySound(SoundFile);
                    render.sounds++;
                    while (Chan.IsPlaying)
                    {
                        System.Threading.Thread.Sleep(10);
                    }

                    SoundFile.Dispose();
                    Chan.Dispose();

                    SoundSystem.CloseSystem();
                    SoundSystem.Dispose();
                    render.sounds--;
                } catch { }
            }).Start();
        }
Пример #3
0
        public static void Main(string[] args)
        {
            Console.WriteLine ("Fmod Play File Test");

            #if DEBUG

            #else
            Linsft.FmodSharp.Debug.Level = Linsft.FmodSharp.DebugLevel.Error;
            #endif

            var SoundSystem = new Linsft.FmodSharp.SoundSystem.SoundSystem();

            Console.WriteLine ("Default Output: {0}", SoundSystem.Output);

            SoundSystem.Init();
            SoundSystem.ReverbProperties = Linsft.FmodSharp.Reverb.Presets.Room;

            if (args.Length > 0) {
                foreach (string StringItem in args) {
                    Linsft.FmodSharp.Sound.Sound SoundFile;
                    SoundFile = SoundSystem.CreateSound (StringItem);

                    Linsft.FmodSharp.Channel.Channel Chan;
                    Chan = SoundSystem.PlaySound(SoundFile);

                    while(Chan.IsPlaying) {
                        System.Threading.Thread.Sleep(10);
                    }

                    SoundFile.Dispose();
                    Chan.Dispose();
                }

            } else {
                Console.WriteLine ("No File to play.");
            }

            SoundSystem.CloseSystem();
            SoundSystem.Dispose();
        }