I'm making an overdrive pedal for electric guitar using C# and NAudio. So far I have managed to output sound from the mic input in real time but now need a way of overdriving the sound.
Are there any tutorials on how to add an overdrive effect to audio in real time using C# and NAudio?
Asked
Active
Viewed 1,308 times
4
-
have you checked NAudio web site to see if there are any examples – MethodMan Jan 23 '13 at 15:15
-
Yes I have but couldnt find any. – thebrodiebrowne Jan 23 '13 at 15:18
-
Heh. I'm so tempted to respond with the answer, "[probably](http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/questions-with-yes-or-no-answers.html)". – neminem May 06 '13 at 20:09
1 Answers
4
The best way to implement your own effects is to get the audio into 32 bit floating point, and then implement your own ISampleProvider
interface. In the Read
method, you read the requested number of samples out of your source, perform your DSP and then write them to the output buffer. Unfortunately NAudio does not include an overdrive effect but you might find some code to get you started at musicdsp.org.
To see some examples of NAudio being used to apply audio effects, have a look at .NET voice recorder (which can do autotune) and Skype Voice Changer (which includes pitch shifting). Both of these samples predate the ISampleProvider
interface, so they implement their own conversion from byte arrays into floating point samples.

Mark Heath
- 48,273
- 29
- 137
- 194