/// <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; }
/// <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); }
private SoundFile(SoundBufferData bufferData) { this.buffer = SoundBuffer.FromData(bufferData); }
/// <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))); }
/// <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))); }