ok I read up on it online and I tried it but it did not work
here is my code
:
https://onedrive.live.com/redir?resid=CC8AF223519E2440!119&authkey=!AAFtwo79tic33IA&ithint=file%2c.wav
the ticking is still there
here is my code
:
double time = Convert.ToDouble(time2.Text) / 2.2675;
time = time * 50000D;
double Amplitude = Convert.ToDouble(Peaktxt.Text);
SaveFileDialog save1 = new SaveFileDialog();
save1.Filter = "Wave file (*.wav)|*.wav;";
if (save1.ShowDialog() != DialogResult.OK) return;
WaveFileWriter wavefile;
wavefile = new WaveFileWriter(save1.FileName, tone.WaveFormat);
double counter3 = 0;
double tenp = 0;
double Ptemp = Peak3 - 0.001D;
if (Beat3 != 0)
{
Beat3 = (1 / Beat3);
tenp = Beat3/(1D / 44100D);
}
else
{
Beat3 = 0;
}
for (int n = 0; n < time; n++)
{
if (counter3 >= Beat3 && Beat3 != 0)
{
for (int t = 0; t < tenp; t++)
{
if (Ptemp > 0.000005)
{
float temo = (float)(Ptemp * Math.Sin((((Math.PI * n * (Frequency3))/2) / 44100D)));
wavefile.WriteSample(Math.Abs(temo));
wavefile.WriteSample(Math.Abs(temo));
Ptemp = Ptemp - 0.001D;
}
else
{
wavefile.WriteSample(0F);
wavefile.WriteSample(0F);
}
}
counter3 = 0;
}
else
{
float temo = (float)(Peak3 * Math.Sin(((( Math.PI * n * (Frequency3))/2)/44100D)));
wavefile.WriteSample(Math.Abs(temo));
wavefile.WriteSample(Math.Abs(temo));
counter3 = counter3 + (1D / 44100D);
}
}
wavefile.Flush();
wavefile.Dispose();
if (waveout == null)
{
waveout = new WaveOut();
waveout.PlaybackStopped += onPlaybackStopped;
}
MixingSampleProvider mixer = new MixingSampleProvider(WaveFormat.CreateIeeeFloatWaveFormat(44100,2));
audioFileReader = new AudioFileReader(save1.FileName);
mixer.AddMixerInput((ISampleProvider)audioFileReader);
SampleToWaveProvider mixer3 = new SampleToWaveProvider(mixer);
try
{
waveout.Init(mixer3);
waveout.Play();
timer1.Start();
}
catch
{
MessageBox.Show(" Error retry");
waveout.Stop();
waveout.Dispose();
waveout = null;
return;
}
}
here is how it soundshttps://onedrive.live.com/redir?resid=CC8AF223519E2440!119&authkey=!AAFtwo79tic33IA&ithint=file%2c.wav
the ticking is still there