• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

Windows Background music that clicks when playing while switching rooms.

Right after switching from my "splash-room" to the "main-menu-title-room", my background music clicks a few times, and then afterwards it plays back stable as it should be.

There are no clicks in the audiofile.

I have tried all the four audio attributes (uncompressed+uncompressed+streamed/not_streamed) and several bit rates (128/320).

I preload the audioground containing the background music.

The music playback is not started before the audioground has been loaded.

There is no switching room before the audioground has been loaded and has been playing for a few seconds.

There are added a few extra seconds before swithing room.

I happens both in Debug(F6) mode and in Run(F5) mode. Windows 10 platform.

The best way to describe this click for me is there is a too small audio buffer somewhere, or that there are cpu spikes when I switch room that disturbs the audio playback.

However I just checked for cpu spikes in the windows task manager and there are non at the same time as the audio clicks.

?
 

TheouAegis

Member
Multiple clicks? That sounds more like CPU workload. Have you tried stopping the current music in the room end and starting the new music in the room start? Or stop the music before you even call room_goto().
 
It would be cpu workload, if the game runs on a single processor, which it most likely does. There are no cpu spikes worth writing about when I watch the task manager while the game automatically switch between the two rooms and while the audio clicks, but I guess the task manager monitors all cpu cores combined for showing the cpu workload graph.

I think it sounds more like a too small buffer for audio playback or an low prioritized audio playback, because I know that when I write music a too small audio buffer caused such audio clicks.

I start the background music in the first room, the "splash room", which loads all ini files, sets up global variabels and shows a "content rating" text etc.. The splash runs for 10 seconds before it automatically goes to the "main-menu-title room". There are no audio clicks in the "splash-room" I dont want to stop the music, and I want the music from the splash room to continue at the main-menu-title room.
Before this attempt, I used one audio file for the splash-room and another audio file for the main-menu-title-room. However I prefer to use the same audio file for both rooms, because I like the flow of the presentation a little better, but if this audio click issue cannot be fixed, then I will have to go back to using two separate audio files, one for each room, instead.
 

obscene

Member
I had this problem once and can't remember exactly how I fixed it, but seems it was caused by loading audio groups and texture groups during the room transition. I think I was doing them both at once and after I separated out the two processes it and made sure I didn't hang the game up in a loop waiting for them to load the issue went away.
 
Top