Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installed Game Audio Files Not Playing #8703

Closed
gm-bug-reporter bot opened this issue Dec 15, 2024 · 1 comment
Closed

Installed Game Audio Files Not Playing #8703

gm-bug-reporter bot opened this issue Dec 15, 2024 · 1 comment
Assignees
Labels
build-bug Bugs when compiling projects inside GameMaker project This issue has a sample project attached

Comments

@gm-bug-reporter
Copy link

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

  • Sentence Listening & Construction - Sia.exe

cb9c280f-cccb-419b-aeae-d595e5101c46

@gm-bug-reporter gm-bug-reporter bot added build-bug Bugs when compiling projects inside GameMaker project This issue has a sample project attached labels Dec 15, 2024
@toby-yoyo toby-yoyo self-assigned this Dec 15, 2024
@stuckie stuckie moved this from Triage to Backlog in Team Workload Dec 16, 2024
@toby-yoyo toby-yoyo moved this from Backlog to In Progress in Team Workload Dec 16, 2024
@toby-yoyo
Copy link

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.

Closing as 'not a bug'.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Team Workload Dec 16, 2024
@toby-yoyo toby-yoyo reopened this Dec 16, 2024
@github-project-automation github-project-automation bot moved this from Done to Triage in Team Workload Dec 16, 2024
@toby-yoyo toby-yoyo closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2024
@github-project-automation github-project-automation bot moved this from Triage to Done in Team Workload Dec 16, 2024
@YYDan YYDan moved this from Done to Not a bug in Team Workload Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-bug Bugs when compiling projects inside GameMaker project This issue has a sample project attached
Projects
Status: Not a bug
Development

No branches or pull requests

1 participant