public Int16AudioSampleGenerator(AudioBuffer <short> audioBuffer) : base(audioBuffer) { }
/// <summary>Determines whether the specified audio buffer is an acceptable buffer.</summary> /// <param name="audioBuffer">The proposed audio buffer.</param> /// <remarks> /// This method will consider <c>null</c> as a valid buffer, even though it is not a buffer. /// The following methods will be called to help determine if the buffer is acceptable: /// <list type="bullet"> /// <item><description><see cref="IsSampleTypeSupported"/></description></item> /// </list> /// </remarks> /// <returns><c>true</c> if the specified audio buffer is acceptable; otherwise, <c>false</c>.</returns> public bool IsAcceptableBuffer(AudioBuffer audioBuffer) { if (audioBuffer == null) return true; return IsSampleTypeSupported(audioBuffer.SampleType) && IsFrequencySupported(44100); }
partial void InitializeAudio() { audioRenderingEnabled = true; audioBuffer = new AudioBuffer <short>(new short[2 * 2 * 44100 / 60]); audioSampleGenerator = new Int16AudioSampleGenerator(audioBuffer as AudioBuffer <short>); }