方波无法在NAudio中正确生成

问题描述 投票:0回答:1

我正在使用NAudio播放方波。当我大胆录制该声音并检查波形时。

无法正常进行。

NAudio生成声音的波形Waveform of NAudio generated sound

Audacity生成声音的波形Waveform of Audacity generated sound

我做错什么了吗?

代码

sine20Seconds = new SignalGenerator()
{
    Gain = 0.5,
    Frequency = Convert.ToDouble(freqBox1.Text)                    
};
sine20Seconds.Type = SignalGeneratorType.Square;
wo = new WaveOutEvent();
wo.Init(sine20Seconds);
wo.Play();
c# naudio waveform
1个回答
1
投票

尝试更改

sine20Seconds.Type = SignalGeneratorType.Triangle;

sine20Seconds.Type = SignalGeneratorType.Square;

根据instructions here

© www.soinside.com 2019 - 2024. All rights reserved.