Пример #1
0
        public void PlayCue(string name)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            ushort cue = FAudio.FACTSoundBank_GetCueIndex(
                handle,
                name
                );

            if (cue == FAudio.FACTINDEX_INVALID)
            {
                throw new InvalidOperationException(
                          "Invalid cue name!"
                          );
            }

            FAudio.FACTSoundBank_Play(
                handle,
                cue,
                0,
                0,
                IntPtr.Zero
                );
        }
Пример #2
0
        public Cue GetCue(string name)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            ushort cue = FAudio.FACTSoundBank_GetCueIndex(
                handle,
                name
                );

            if (cue == FAudio.FACTINDEX_INVALID)
            {
                throw new InvalidOperationException(
                          "Invalid cue name!"
                          );
            }

            IntPtr result;

            FAudio.FACTSoundBank_Prepare(
                handle,
                cue,
                0,
                0,
                out result
                );
            return(new Cue(result, name, this));
        }
Пример #3
0
        public void PlayCue(
            string name,
            AudioListener listener,
            AudioEmitter emitter
            )
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }
            if (listener == null)
            {
                throw new ArgumentNullException("listener");
            }
            if (emitter == null)
            {
                throw new ArgumentNullException("emitter");
            }

            ushort cue = FAudio.FACTSoundBank_GetCueIndex(
                handle,
                name
                );

            if (cue == FAudio.FACTINDEX_INVALID)
            {
                throw new InvalidOperationException(
                          "Invalid cue name!"
                          );
            }

            emitter.emitterData.ChannelCount        = dspSettings.SrcChannelCount;
            emitter.emitterData.CurveDistanceScaler = float.MaxValue;
            FAudio.FACT3DCalculate(
                engine.handle3D,
                ref listener.listenerData,
                ref emitter.emitterData,
                ref dspSettings
                );
            FAudio.FACTSoundBank_Play3D(
                handle,
                cue,
                0,
                0,
                ref dspSettings,
                IntPtr.Zero
                );
        }