Click here to Skip to main content
15,887,812 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I want to play a sound(tone) at specified volumes and frequencies but want the duration of playback fixed say 2 seconds.

My code is similar to one given here.

double freq, volume;
WaveTone tone = new WaveTone(freq, volume);
stream = new BlockAlignReductionStream(tone);
output = new DirectSoundOut();
output.Init(stream);
output.Play();

I tried to use latency in DirectSoundOut() above but it did not work as desired. I have to change freq and volume dynamically for each playback. So I need to know the exact duration of playback of tone. Thanks.
Posted
Comments
[no name] 28-Jul-13 7:00am    
Good

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900