4

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.

Undo
  • 25,519
  • 37
  • 106
  • 129

1 Answers1

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