Issues with playing back recorded audio in web export

Godot Version

v4.5

Heya, a friend and I are participating in a game jam that requires the final version to be uploaded on itch, we’ve come up with an idea we like and started working on it, the issues we’re having is that it very fundamentally relies on the ability to record the player’s audio and then play it back later at certain points.
I managed to make a system for doing so in gdscript which works fine while running through godot (on Compatibility mode) but out of caution tried a quick build for web and ran it on localhost through vscode and as I feared it appears to not be working there, the microphone is being picked up correctly as I can tell by a visual waveform, but playing back the audio directly from the AudioStreamPlayer or by saving it to a wav and loading that both don’t work.
I’ve tried manually setting some of the configurations of the recording, and saving the wav to user instead of res but neither solved the issues, there isn’t a lot of information on the subject I could find.
Attached are the main script for handling the recordings (recording_screen.gd: recording_screen.gd - Pastebin.com), as well as the one for visualizing the recording (timeline.gd: timeline.gd - Pastebin.com) which I don’t think is relevant but just in case, as well as pictures of my audio busses and scene hierarchy. Apologies for the messy code, still fairly new and don’t have a ton of time to format it well.

If anyone has any ideas on how to get this working on web I’d appreciate it, thanks <3

IIRC, WAV isn’t a supported audio file type for web. Trying saving it as an MP3 and see if that solves your problem.

From what I can tell godot doesn’t have a way to save to mp3, only wav.

Try outputting it directly through the Master bus instead of the RecordOutput bus. As of 4.5 I have had trouble with sound output in web and that was my solution.

Both the play button and my attempts to play the saved wav file use a seperate AudioStreamPlayer which is set to the master bus, RecordOutput is only used for AudioStreamRecord which is a seperate player.

My next recommendation then would be to log a bug. Either the Godot developers will tell you how to solve your problem, or they will fix the bug.

Alright, thanks!

1 Like