Example #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine ("Fmod Driver Info Test");

            #if DEBUG

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

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

            Console.WriteLine("OutputDrivers");
            foreach (Linsft.FmodSharp.SoundSystem.OutputDriver DriverItem in SoundSystem.OutputDrivers) {
                Console.WriteLine("  {0}", DriverItem.Name);
                Console.WriteLine("    Guid: {0}", DriverItem.Guid);
                Console.WriteLine("    Capabilities: {0}", DriverItem.Capabilities);
                Console.WriteLine("    Minimum Frequency: {0}", DriverItem.MinimumFrequency);
                Console.WriteLine("    Maximum Frequency: {0}", DriverItem.MaximumFrequency);
                Console.WriteLine("    Speaker Mode: {0}", DriverItem.SpeakerMode);
            }
            Console.WriteLine("");

            Console.WriteLine("RecordDrivers");
            foreach (Linsft.FmodSharp.SoundSystem.RecordDriver DriverItem in SoundSystem.RecordDrivers) {
                Console.WriteLine("  {0}", DriverItem.Name);
                Console.WriteLine("    Guid: {0}", DriverItem.Guid);
                Console.WriteLine("    Capabilities: {0}", DriverItem.Capabilities);
                Console.WriteLine("    Minimum Frequency: {0}", DriverItem.MinimumFrequency);
                Console.WriteLine("    Maximum Frequency: {0}", DriverItem.MaximumFrequency);
            }

            SoundSystem.Dispose();
        }
Example #2
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Fmod Driver Info Test");

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

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

            Console.WriteLine("OutputDrivers");
            foreach (Linsft.FmodSharp.SoundSystem.OutputDriver DriverItem in SoundSystem.OutputDrivers)
            {
                Console.WriteLine("  {0}", DriverItem.Name);
                Console.WriteLine("    Guid: {0}", DriverItem.Guid);
                Console.WriteLine("    Capabilities: {0}", DriverItem.Capabilities);
                Console.WriteLine("    Minimum Frequency: {0}", DriverItem.MinimumFrequency);
                Console.WriteLine("    Maximum Frequency: {0}", DriverItem.MaximumFrequency);
                Console.WriteLine("    Speaker Mode: {0}", DriverItem.SpeakerMode);
            }
            Console.WriteLine("");

            Console.WriteLine("RecordDrivers");
            foreach (Linsft.FmodSharp.SoundSystem.RecordDriver DriverItem in SoundSystem.RecordDrivers)
            {
                Console.WriteLine("  {0}", DriverItem.Name);
                Console.WriteLine("    Guid: {0}", DriverItem.Guid);
                Console.WriteLine("    Capabilities: {0}", DriverItem.Capabilities);
                Console.WriteLine("    Minimum Frequency: {0}", DriverItem.MinimumFrequency);
                Console.WriteLine("    Maximum Frequency: {0}", DriverItem.MaximumFrequency);
            }

            SoundSystem.Dispose();
        }
Example #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();
        }
Example #4
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();
        }
Example #5
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();
        }
Example #6
0
        public static void Main(string[] args)
        {
            Console.WriteLine ("Fmod Sound Test");

            #if DEBUG

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

            Console.WriteLine ("Level: {0}", Linsft.FmodSharp.Debug.Level);
            Console.WriteLine ("Type: {0}", Linsft.FmodSharp.Debug.Type);
            Console.WriteLine ("Display: {0}", Linsft.FmodSharp.Debug.Display);

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

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

            SoundSystem.Init();

            Linsft.FmodSharp.Channel.Channel Chan = null;

            //Create an oscillator DSP unit for the tone.
            Linsft.FmodSharp.Dsp.Dsp Oscillator;

            Oscillator = SoundSystem.CreateDspByType(Linsft.FmodSharp.Dsp.Type.Oscillator);
            Chan = SoundSystem.PlayDsp(Oscillator);

            Console.WriteLine("\nPress Enter to stop.\n");
            bool Quit = false;
            while(!Quit) {
                switch (Console.ReadKey().Key) {

                case ConsoleKey.Enter:
                case ConsoleKey.Escape:
                    Quit = true;
                    break;

                    //Change note
                case ConsoleKey.LeftArrow :
                    //Oscillator.setParameter((int)FMOD.DSP_OSCILLATOR.RATE, 440.0f);
                    break;

                case ConsoleKey.RightArrow:
                    //Oscillator.setParameter((int)FMOD.DSP_OSCILLATOR.RATE, 440.0f);
                    break;

                    //Change Volume
                case ConsoleKey.UpArrow:
                    Chan.Volume += 0.05f;
                    break;

                case ConsoleKey.DownArrow:
                    Chan.Volume -= 0.05f;
                    break;

                    //Change Tone
                case ConsoleKey.Spacebar:
                    //dsp.setParameter((int)FMOD.DSP_OSCILLATOR.TYPE, 0);
                    //channel.setPaused(false);
                    break;

                default:
                    break;
                }

                System.Threading.Thread.Sleep(10);
            }
            Chan.Dispose();
            SoundSystem.CloseSystem();
            SoundSystem.Dispose();
        }
Example #7
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Fmod Sound Test");

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

            Console.WriteLine("Level: {0}", Linsft.FmodSharp.Debug.Level);
            Console.WriteLine("Type: {0}", Linsft.FmodSharp.Debug.Type);
            Console.WriteLine("Display: {0}", Linsft.FmodSharp.Debug.Display);

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

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

            SoundSystem.Init();

            Linsft.FmodSharp.Channel.Channel Chan = null;

            //Create an oscillator DSP unit for the tone.
            Linsft.FmodSharp.Dsp.Dsp Oscillator;

            Oscillator = SoundSystem.CreateDspByType(Linsft.FmodSharp.Dsp.Type.Oscillator);
            Chan       = SoundSystem.PlayDsp(Oscillator);

            Console.WriteLine("\nPress Enter to stop.\n");
            bool Quit = false;
            while (!Quit)
            {
                switch (Console.ReadKey().Key)
                {
                case ConsoleKey.Enter:
                case ConsoleKey.Escape:
                    Quit = true;
                    break;

                //Change note
                case ConsoleKey.LeftArrow:
                    //Oscillator.setParameter((int)FMOD.DSP_OSCILLATOR.RATE, 440.0f);
                    break;

                case ConsoleKey.RightArrow:
                    //Oscillator.setParameter((int)FMOD.DSP_OSCILLATOR.RATE, 440.0f);
                    break;

                //Change Volume
                case ConsoleKey.UpArrow:
                    Chan.Volume += 0.05f;
                    break;

                case ConsoleKey.DownArrow:
                    Chan.Volume -= 0.05f;
                    break;

                //Change Tone
                case ConsoleKey.Spacebar:
                    //dsp.setParameter((int)FMOD.DSP_OSCILLATOR.TYPE, 0);
                    //channel.setPaused(false);
                    break;

                default:
                    break;
                }

                System.Threading.Thread.Sleep(10);
            }
            Chan.Dispose();
            SoundSystem.CloseSystem();
            SoundSystem.Dispose();
        }