Click here to Skip to main content
15,887,946 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing a winForm application in c#. I want to play a .wav file at different frequencies (not at different sample rates i.e. 440Hz, 220Hz etc.). I want audible frequencies from 20Hz to 20,000Hz. Can anybody help me in this problem!
Posted
Comments
Bernhard Hiller 16-Jul-13 10:55am    
Do you want to create sounds with those frequencies and play the sounds?
mansurmojom 16-Jul-13 11:54am    
No, I have a sound file and I want to change its frequency programmatically during runtime and play it!

As far as I know, if you play a WAV file at different sample rates (if you can do it) then you get different frequencies (suppose you have a file containing a 440 hz sound at sample rate of 8 khz, if you use its data at 16 khz sample rate then you obtain a 880 hz sound).
I suppose, however, you have to create different WAV files for the frequencies you intend to support.
 
Share this answer
 
That's called "transposition" when e.g. a song originally played in C major is reproduced in E major. I haven't yet done that, but a similar problem is playback at different speed without affecting the pitch. An example for that can be found e.g. in Audacity (in C++ though). When you first change the speed, and afterwards change the header information for the sampling rate, you should arrive at the desired result.
 
Share this answer
 

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