コード例 #1
0
ファイル: OggStream.cs プロジェクト: tomrijnbeek/Cireon.Audio
        /// <summary>
        /// Creates a new ogg-filestream.
        /// </summary>
        /// <param name="stream">The ogg-filestream.</param>
        /// <param name="bufferCount">The amount of buffers to use.</param>
        public OggStream(Stream stream, int bufferCount = defaultBufferCount)
        {
            this.BufferCount = bufferCount;

            this.Buffer = new SoundBuffer(bufferCount);
            this.Source = new Source();

            //if (ALHelper.XRam.IsInitialized)
            //{
            //    ALHelper.XRam.SetBufferMode(BufferCount, ref alBufferIds[0], XRamExtension.XRamStorage.Hardware);
            //    ALHelper.Check();
            //}

            this.Volume = 1;
            this.Pitch  = 1;

            if (AudioManager.Instance.Efx.IsInitialized)
            {
                alFilterId = AudioManager.Instance.Efx.GenFilter();
                AudioManager.Instance.Efx.Filter(alFilterId, EfxFilteri.FilterType, (int)EfxFilterType.Lowpass);
                AudioManager.Instance.Efx.Filter(alFilterId, EfxFilterf.LowpassGain, 1);
                this.lowPassGain = 1;
            }

            this.underlyingStream = stream;
        }
コード例 #2
0
ファイル: Source.cs プロジェクト: tomrijnbeek/Cireon.Audio
 /// <summary>
 /// Adds a new sound buffer to be played by this source.
 /// </summary>
 /// <param name="buffer"></param>
 public void QueueBuffer(SoundBuffer buffer)
 {
     this.QueueBuffers(buffer.Handles.Length, buffer.Handles);
 }
コード例 #3
0
ファイル: SoundFile.cs プロジェクト: tomrijnbeek/Cireon.Audio
 private SoundFile(SoundBufferData bufferData)
 {
     this.buffer = SoundBuffer.FromData(bufferData);
 }
コード例 #4
0
 /// <summary>
 /// Creates a new soundbuffer from an uncompressed wave-file.
 /// </summary>
 /// <param name="file">The file to load the data from.</param>
 /// <returns>A SoundBuffer object containing the data from the specified file.</returns>
 public static SoundBuffer FromWav(Stream file)
 {
     return(SoundBuffer.FromData(SoundBufferData.FromWav(file)));
 }
コード例 #5
0
 /// <summary>
 /// Creates a new soundbuffer from an uncompressed wave-file.
 /// </summary>
 /// <param name="file">The file to load the data from.</param>
 /// <returns>A SoundBuffer object containing the data from the specified file.</returns>
 public static SoundBuffer FromWav(string file)
 {
     return(SoundBuffer.FromWav(File.OpenRead(file)));
 }