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

Typing sounds work in the editor but do not work on export #1834

Closed
DancingEngie opened this issue Oct 27, 2023 · 4 comments · Fixed by #1848
Closed

Typing sounds work in the editor but do not work on export #1834

DancingEngie opened this issue Oct 27, 2023 · 4 comments · Fixed by #1848
Labels
Bug 🐞 Something isn't working Needs testing More feedback/testing would be good

Comments

@DancingEngie
Copy link

The problem

Describe the bug
When providing a style with a typing sounds folder, the typing sounds can be heard in the editor but not on export.

To Reproduce

  1. Create a new timeline and character, and write some sample dialogue.
  2. Choose any style and provide it with a typing SFX folder in the "sounds" tab.
  3. Call the new timeline by any means you see fit.
  4. Play the timeline in the editor, and see that everything is working properly.
  5. Export the game and launch it.
  6. Observe that dialogues have no typing SFX.

Expected behavior
Typing sounds should be heard in all platforms.

System (please complete the following information):

  • OS: Windows 10
  • Godot Version: 4.1.2
  • Dialogic Version: Alpha 10

Solutions

Workaround

After many, MANY attempts with console printouts, I found that the load_sounds_from_path function does not recognize exported .wav files. It does, however, recognize .import files. Therefore, this (extremely dirty) rewrite works:

static func load_sounds_from_path(path:String):
	var dir = DirAccess.open(path)
	var sounds : Array[AudioStream]
	if dir:
		dir.list_dir_begin()
		var file_name = dir.get_next()
		while file_name != "":
			print(file_name)
			if file_name.get_extension() == "import":
				file_name = file_name.split(".import")[0]
				var stream:AudioStream = load(path + "/" + file_name)
				sounds.append(stream)
			file_name = dir.get_next()
	return sounds

Possible fixes

Rewriting the function to work with Godot's internal build logic, I guess. Maybe it's something that needs to be brought up with the engine, but I dunno, I'm a noob.

@Jowan-Spooner Jowan-Spooner added Bug 🐞 Something isn't working Needs testing More feedback/testing would be good labels Oct 28, 2023
@Jowan-Spooner Jowan-Spooner added this to the Version 2.0 (beta) milestone Oct 28, 2023
@Jowan-Spooner
Copy link
Collaborator

@DancingEngie Thanks for the report!
We've had similar struggles before so I will try to fix it as best as possible for the next release.

Jowan-Spooner added a commit that referenced this issue Oct 30, 2023
The load_typing_sounds method will now always list imported audio files only and correctly load them when exported.
Jowan-Spooner added a commit that referenced this issue Oct 31, 2023
* Make sure typing sound resets on text without character

- fixes #1842

* Fix #1834

The load_typing_sounds method will now always list imported audio files only and correctly load them when exported.
@Jowan-Spooner
Copy link
Collaborator

I think this is fixed now on main.

@DancingEngie
Copy link
Author

I think this is fixed now on main.

For some reason defining the var type in the for loop breaks that segment. Removing that makes everything actually work. Dunno why. But other than that, the issue is indeed fixed.

image
image

@Jowan-Spooner
Copy link
Collaborator

Oh damn. I'm so dumb. I'm already using 4.2 alpha 3 and it has static typing in for-loops.
Will remove this. We still need to decide whether we want to increase the minimal needed godot version again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Something isn't working Needs testing More feedback/testing would be good
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants