I’m trying to invert a sound wave (phase shift 180 degrees), but I’m not exactly sure how I would go about doing this. Can any audio programmers point me in the right direction?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Inverting a sound wave should be generally easy if you have access to the byte array that makes up the sound. You simply need to take the negative of each value in the stream.
Audio streams come in many different flavors so it’s impossible to be specific. However, if it was a 16bit PCM stream, which is full of 2-byte values, you’d loop over the data and for each two bytes in the stream: cast it to a short, take the negative of it, and put it back into the byte stream.