I am using NAudio to play a Square wave. When i record that sound in audacity and check the waveform.
It is not coming properly.
Waveform of NAudio generated sound
Waveform of Audacity generated sound
Am i doing some thing Wrong ?
Code
sine20Seconds = new SignalGenerator()
{
Gain = 0.5,
Frequency = Convert.ToDouble(freqBox1.Text)
};
sine20Seconds.Type = SignalGeneratorType.Square;
wo = new WaveOutEvent();
wo.Init(sine20Seconds);
wo.Play();
Try changing
sine20Seconds.Type = SignalGeneratorType.Triangle;
to
sine20Seconds.Type = SignalGeneratorType.Square;
as per instructions here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.