You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I test my game in Gamemaker, the audio files play fine. However, when I make an executable and install the game on another desktop machine the audio files playing sentenes (beginning with "G") don't play, even though the other sound effects, labelled "effx_" do play. I firstly tried the files compressed and streamed, with this result (even though the resulted .ogg audios, when played directly from the install on the new machine played fine, so the PC does play .ogg files. Then I deleted them and reinserted them as uncompressed, not streamed files (as they are in this build provided here), with the same result. The PC just doesn't play the "G" files, but does play the "effx_" files. I have another game that I made that I have installed on the same windows PC, using similar .mp3 originating files, and that game works fine on that same PC, not problem with the audio whatsoever. Both my "dev" laptop that I program from and the desktop I installed it on are Windows 11 PCs. Please see forum posts if you need some background to either of these games - I'm a very recent programming learner - just learning of the net from YouTube and these forums. I have attached the executable also, in case that helps.
Steps To Reproduce
Play the game in Gamemaker LTS and the audios play fine. Create an executable and it only plays the "effx_" files.
Which version of GameMaker are you reporting this issue for?
IDE v2022.0.3.83 Runtime v2022.0.3.98
Which operating system(s) are you seeing the problem on?
This one is a user error. Below is the problematic code:
var _currentSound = asset_get_index(string(global.currentSentence.SoundFile));
show_debug_message("File to play is " + string(_currentSound));
audio_play_sound(_currentSound,0,false);
The issue here is that asset_get_index is returning -1 as it is not finding an asset with a name that matches the string in global.currentSentence.SoundFile. Looking more closely, I can see that the string in global.currentSentence.SoundFile is a hardcoded path that originates from the data stored in the included file sentences.json. These paths do not match the names of the corresponding sounds in the asset browser, and so -1 (an invalid index) is returned when they are passed into asset_get_index.
To fix this issue, the user should either include the asset name as it appears in the asset browser in their JSON data and retrieve that when playing a sentence, or find a way to transform each file path into its name in the asset browser before calling asset_get_index.
Description
When I test my game in Gamemaker, the audio files play fine. However, when I make an executable and install the game on another desktop machine the audio files playing sentenes (beginning with "G") don't play, even though the other sound effects, labelled "effx_" do play. I firstly tried the files compressed and streamed, with this result (even though the resulted .ogg audios, when played directly from the install on the new machine played fine, so the PC does play .ogg files. Then I deleted them and reinserted them as uncompressed, not streamed files (as they are in this build provided here), with the same result. The PC just doesn't play the "G" files, but does play the "effx_" files. I have another game that I made that I have installed on the same windows PC, using similar .mp3 originating files, and that game works fine on that same PC, not problem with the audio whatsoever. Both my "dev" laptop that I program from and the desktop I installed it on are Windows 11 PCs. Please see forum posts if you need some background to either of these games - I'm a very recent programming learner - just learning of the net from YouTube and these forums. I have attached the executable also, in case that helps.
Steps To Reproduce
Play the game in Gamemaker LTS and the audios play fine. Create an executable and it only plays the "effx_" files.
Which version of GameMaker are you reporting this issue for?
IDE v2022.0.3.83 Runtime v2022.0.3.98
Which operating system(s) are you seeing the problem on?
Windows 10.0.22631.0
Which platform(s) are you seeing the problem on?
Windows
Attached Files
cb9c280f-cccb-419b-aeae-d595e5101c46
The text was updated successfully, but these errors were encountered: