Inheritance: SoundWAVI
コード例 #1
0
ファイル: SoundWAV.cs プロジェクト: damian-666/ReignSDK
        public unsafe SoundWAVInstance(SoundWAV sound, bool looped)
            : base(sound)
        {
            State  = SoundStates.Stopped;
            Looped = looped;
            Volume = 1;

            uint instanceTEMP = 0;

            AL.GenSources(1, &instanceTEMP);
            instance = instanceTEMP;
            if (instance == 0)
            {
                Debug.ThrowError("SoundWAVInstance", "Failed to create instance");
            }

            AL.Sourcei(instance, AL.BUFFER, (int)sound.buffer);
            AL.Sourcef(instance, AL.PITCH, 1);
            AL.Sourcef(instance, AL.GAIN, 1);
            AL.Source3f(instance, AL.POSITION, 0, 0, 0);
            AL.Source3f(instance, AL.VELOCITY, 0, 0, 0);
            AL.Sourcei(instance, AL.LOOPING, looped ? AL.TRUE : AL.FALSE);
        }
コード例 #2
0
ファイル: SoundWAV.cs プロジェクト: reignstudios/ReignSDK
        public unsafe SoundWAVInstance(SoundWAV sound, bool looped)
            : base(sound)
        {
            State = SoundStates.Stopped;
            Looped = looped;
            Volume = 1;

            uint instanceTEMP = 0;
            AL.GenSources(1, &instanceTEMP);
            instance = instanceTEMP;
            if (instance == 0) Debug.ThrowError("SoundWAVInstance", "Failed to create instance");

            AL.Sourcei(instance, AL.BUFFER, (int)sound.buffer);
            AL.Sourcef(instance, AL.PITCH, 1);
            AL.Sourcef(instance, AL.GAIN, 1);
            AL.Source3f(instance, AL.POSITION, 0, 0, 0);
            AL.Source3f(instance, AL.VELOCITY, 0, 0, 0);
            AL.Sourcei(instance, AL.LOOPING, looped ? AL.TRUE : AL.FALSE);
        }