AudioPitchShifter plays a part of the previous audio stream before playing the new one

After stopping an audio stream that is going through an AudioPitchShifter, and then either playing a different audio stream that is going through that same AudioPitchShifter or the same audio stream from a different time position, a part of the previous audio stream will still be heard for some frames.


(It’s more noticeable when playing “Song2”)

I haven’t experienced this issue with any of the other audio effects, setting .Bypass to true seems to fix the issue but obviously it doesn’t apply the pitch effect (Also unrelated but why is AudioPitchShifter the only effect to have a WindowSize property? It seems to only change the quality of the output stream)

Reproduction file:
AudioBugRepro.rbxl (52.4 KB)

Expected behavior

AudioPitchShifter’s output should not contain a part of the audio stream playing before it was paused / stopped after the input audio stream is resumed / a different one starts playing

It seems that it is repeating the previous audio stream always? It’s a weird type of echo (?), here’s a comparison between PitchShiftSoundEffect and AudioPitchShifter, which (going off by documentation) should work the same way as the other (Except that the new one limits the output via WindowSize (shouldn’t there be an unlimited one or one that outputs with the same audio quality as PitchShiftSoundEffect?))


Audio is sped up by 2 so that it’s more noticeable, both pitch effects have a value or 0.5

Hi - to answer your question about WindowSize, the AudioPitchShifter works by looking at input audio in chunks at a time (or otherwise some past chunk of audio), and the WindowSize property controls how large those chunks are. (This info appears to be missing from our documentation - we’ll look into that.) Currently the Medium setting should be identical to what PitchSoundEffect uses. If you’re using a larger window size, that might produce the “echo-y” effect you’re hearing.

2 Likes

Why is the property undocumented tho? There are many properties of Audio instances that are undocumented. No description at all

Hi, we enabled to fix that should address this. Let us know if you’re still experiencing the problem. Also, the lack of documentation should be fixed as well.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.