portaudio icon indicating copy to clipboard operation
portaudio copied to clipboard

play.go example aiff file sounds "strange"

Open rabidmachine9 opened this issue 2 years ago • 2 comments

Trying to playback an aiff file with the play.go example, playback is almost correct still the sound is weird like there is some kind of bandpass filter shadowing a frequency range. There is no problem with the file it plays correctly in other players. Are all files supposed to play correctly in the example or maybe I should change the some configurations ?

Not sure if this is a problem with the code or it is supposed to be that way. Thanks for any support

rabidmachine9 avatar Nov 04 '22 19:11 rabidmachine9

Ok, I am pretty sure what is happening is that I am using a stereo file and the example is supposed to play mono, still could someone guide me to make it play properly ?

rabidmachine9 avatar Nov 05 '22 15:11 rabidmachine9

It might be as simple as passing 2 instead of 1 as the second argument to OpenDefaultStream. This assumes your audio file has the samples interleaved (left, right, left, right, ...), which I think is typical. If they're not interleaved, it will take a bit more work to pass them to the portaudio stream.

gordonklaus avatar Nov 06 '22 19:11 gordonklaus