Inverting a sound wave should usually be simple if you have access to the byte array that makes up the sound. You just need to accept the negative value of each value in the stream.
Audio streams come in many variations, so it's impossible to be specific. However, if it was a 16-bit PCM stream that was filled with 2-byte values, you should iterate over the data for every two bytes in the stream: drop it to short, accept a negative result and put it back into the byte stream.
source share