Previous in Forum: Linux Download   Next in Forum: Microsoft Office 365, What a Waste! Or Am I Being Unfair?
Close
Close
Close
3 comments
Rate Comments: Nested
Participant

Join Date: May 2014
Posts: 1

Ticking in My WAV File

05/25/2014 6:58 AM

I am trying to make a tone file and it is working. but it is not sounding the way I want it to sound. There is a low tone beat in the file. that I did not add to it. And I do not know why it is there..

Someone told me to try fading out / fade in and not just going down to 0 and I did but it did not work.

can anyone help me ?

I just need to remove the ticking and output the right Frequency

here is my code:

tone = new isochronicTone(); tone.SetWaveFormat(44100, 2);

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;

int newcounter = 0;

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(temo);

wavefile.WriteSample(temo);

n++;

Ptemp = Ptemp - 0.001D;

newcounter++;

}

else if ((tenp - newcounter) <= 0 )

{

float temo = (float)(Ptemp * Math.Sin((((Math.PI * n * (Frequency3))/2) / 44100D)));

wavefile.WriteSample(temo);

wavefile.WriteSample(temo);

n++;

Ptemp = Ptemp + 0.001D;

}

else

{

wavefile.WriteSample(0F);

wavefile.WriteSample(0F);

n++;

}

}

counter3 = 0;

}

else

{

float temo = (float)(Peak3 * Math.Sin(((( Math.PI * n * (Frequency3))/2)/44100D))); wavefile.WriteSample(temo);

wavefile.WriteSample(temo);

counter3 = counter3 + (1D / 44100D);

Ptemp = Peak3 - 0.001D; newcounter = 0;

}

}

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();

} catch

{

MessageBox.Show(" Error retry");

waveout.Stop();

waveout.Dispose();

waveout = null;

return;

}

What am i doing wrong ?

here is how it sounds:
https://onedrive.live.com/redir?resid=CC8AF223519E2440!119&authkey=!AAFtwo79tic33IA&ithint=file%2c.wav

Register to Reply
Pathfinder Tags: wave File
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33392
Good Answers: 1817
#1

Re: ticking in my wav file

05/25/2014 11:55 AM
__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9915
Good Answers: 1141
#2

Re: Ticking in My WAV File

05/25/2014 7:29 PM

I can't exactly follow your code right now, but I do recall once generating a white noise file to play through headphones to help me concentrate in an office with a lot of "collaboration" going on.

I set it up to play the file in a loop. There's always a click between when the file play ends and it starts again. Maybe that is what is going on here. Sorry I can't help any more.

Register to Reply
Guru

Join Date: Mar 2011
Location: Sebastopol, California
Posts: 1205
Good Answers: 54
#3

Re: Ticking in My WAV File

05/26/2014 11:44 AM

Why can't you use audacity and a few plugins to create this?

What I hear is your tone is pulsed. You may have created the wave form fine, but it may not have enough durration and/or is leaving a gap between sections of tone.

What is the target frequency, waveform, and duration?

I just looked at it in Audacity and what you have is a square-wave that rises several times and then goes flat until the next burst, just like it sounds. You should download Audacity (free) and take a look at what you made. Then, just use the built in signal generator and make one that is right.

__________________
Most people are mostly good most of the time.
Register to Reply
Register to Reply 3 comments
Copy to Clipboard

Users who posted comments:

Deefburger (1); Rixter (1); SolarEagle (1)

Previous in Forum: Linux Download   Next in Forum: Microsoft Office 365, What a Waste! Or Am I Being Unfair?

Advertisement