Click here to Skip to main content
15,746,302 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();

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.
[no name] 28-Jul-13 7:00am    

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