+2 votes

I'm working on a game, and I have implemented footstep sounds for when you walk/run/jump, etc. It works correctly but, for some reason, the footstep sound gets progressively worse/more compressed each time it's played, and I have no idea what's happening.

Here's a video: https://streamable.com/s/7cnt4/jhzkwj

Audio is played from a function in the script SonsDePasso.gd found in the node TestPlanet/Scrat/Jogador/SonsDePasso. This function has two arguments for volume and pitch (which set volumedb and pitchscale for the "Steps" bus, that the SonsDePasso node is a part of.), and it is called from the AnimationPlayer's animations, as well as Jogador.gd's jumping function.

Here's my project files if you want to take a look: https://drive.google.com/open?id=1FtarRKZX2nt4cDMCNbYxdikFy2ucfS0O

in Engine by (90 points)

Tava testando aqui o projeto, realmente muito estranho. Removi aquelas alterações no volume e pitch que tu fez na função _passo mas o problema continuou. Talvez seja o arquivo de áudio. Tenta com .ogg pra ver se funciona. Boa sorte!

Vou tentar isso, então.

Eu fiz isso, mas agora toda vez que o som toca ele toca em loop e nunca mais para! Às vezes até no editor. Eu não fiz nenhuma alteração no código.

É que por padrão ogg é importado em loop. Seleciona o arquivo em em cima da scene tree tem uma aba "Import". Clica la, desativa o loop e clica em re-import

Eu desativei o loop, mas o problema da perda de qualidade persistiu. Decidi tirar o AudioStreamPlayer do bus que eu tava usando pra mudar o pitch e o volume, e o problema desapareceu. Descobri que o problema tem alguma coisa a ver com o efeito de PitchShift, porque foi só adicionar ele ao bus Master que o problema voltou na hora.

Tem chance de isso ser um bug na engine, ou sou eu que não sei usar, mesmo?

Dai não vou saber te dizer, nunca mexi com isso. Te recomendo fazer um issue no GitHub explicando e, se for bug já deixa o issue aberto lá e se não for os caras te explicam oq tu tava fazendo errado.

Issues no GH: https://github.com/godotengine/godot/issues

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.