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

Localization remap doesn't work for Ogg Vorbis sounds, when language is changed at run-time #42847

Open
Tracked by #76797
Vinsinho opened this issue Oct 16, 2020 · 6 comments

Comments

@Vinsinho
Copy link

Vinsinho commented Oct 16, 2020

Godot version:
v3.2.3

OS/device including version:
Windows 10

Issue description:

  • When language is changed real-time, remapping the sounds doesn't work.
  • Same bug is when trying to play from AudioStream or AudioStream2D.
  • Works fine is specific language is selected as default (project settings->locale).
  • The problem occurs with .ogg files
  • System works when using .wav files.

Steps to reproduce:
Test 1:

  1. Open the test project.
  2. Open VOTEst.tscn
  3. Run the scene
  4. Placeholder voiceover will be looping (golden ball is in the game). Default language is english.
  5. Use keys 1-3 to dynamically change the locale (1 = french, 2 = deutch, 3 = english)
  6. As soon as language is changed, there will be a silence instead of voiceover in different language
  7. Notice that the golden letter switches correctly, meaning remap works fine for textures.

Test 2:

  1. Change the default language in Project setting/General/Locale to "de" or "fr"
  2. Run the scene
  3. Appropriate sounds are playing

Expected results :
Based on the locale, sounds should be remaped to appropriate ogg, even realtime

Minimal reproduction project:
TestVO.zip

@Calinou Calinou changed the title Localization remap doesn't work for sounds, when language is changed realtime Localization remap doesn't work for Ogg Vorbis sounds, when language is changed realtime Oct 16, 2020
@Calinou Calinou changed the title Localization remap doesn't work for Ogg Vorbis sounds, when language is changed realtime Localization remap doesn't work for Ogg Vorbis sounds, when language is changed at run-time Oct 16, 2020
@Valeryn4
Copy link
Contributor

problem is real!
There was a problem during localization.
50MB of voice acting in wav weighs too much.
Sometimes a detected problem leads to a crash or random sound. (My project has ~60 sound files in each language)
What exactly is the problem with switching? I would edit the source myself.

@Calinou
Copy link
Member

Calinou commented Jul 27, 2022

Can you test this with MP3 sounds instead of Ogg Vorbis?

@Valeryn4
Copy link
Contributor

Can you test this with MP3 sounds instead of Ogg Vorbis?

yes I checked.
Mp3 doesn't work either.
Mp3 sometimes distorts the original file after changing the localization.

@rsubtil
Copy link
Contributor

rsubtil commented Jul 28, 2022

I remember having a look at this at the time, and I think it had something to do with files having different bitrates (some were 44.1 KHz and others 48KHz), and Godot not updating that information and playing files at a wrong bitrate.

@Valeryn4 can you check if your audio files are all at the same bitrate? And check if there's no issues when switching from files at the same bitrates?

You can use file to quickly check:

$ file **/*.mp3
assets/file_example_MP3_1MG.mp3: Audio file with ID3 version...320 kbps, 44.1 kHz, Stereo
                                                                         ^^^^^^^^
...

@Valeryn4
Copy link
Contributor

for i in *.wav; do ffmpeg -i "$i" -vn -ar 44100 -ac 2 -b:a 192k "${i%.*}.mp3"; done

$ file ./*.mp3
./donuts.mp3:  Audio file with ID3 version 2.4.0, contains:MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, Stereo
./eight.mp3:   Audio file with ID3 version 2.4.0, contains:MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, Stereo
./fishes.mp3:  Audio file with ID3 version 2.4.0, contains:MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, Stereo
./five.mp3:    Audio file with ID3 version 2.4.0, contains:MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, Stereo
./flowers.mp3: Audio file with ID3 version 2.4.0, contains:MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, Stereo
./four.mp3:    Audio file with ID3 version 2.4.0, contains:MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, Stereo

image

In this test set, it works correctly. But later one of the localizations will stop working.
test_AUDIO.zip

Just press various buttons and press the play button.
mp3 starts chewing sound.

image

@e1e5en-gd
Copy link

e1e5en-gd commented Sep 23, 2022

Error in editors 3.5, 3.5.1rc2

The editor closes when working with AudioStreamPlayer. If a file with the *.ogg extension of several megabytes in size is specified in the stream field. And then rename this file, then the import operation will occur and the editor will close either when trying to start a melody (set playing to true), or clear the stream field, it may hang.

  1. Create an empty project.
  2. Add a file of several megabytes with the extension *.ogg to the project.
  3. Add the AudioStreamPlayer node.
  4. Save the scene.
  5. Specify in the stream field the file with the extension *.ogg, downloaded earlier.
  6. Rename the file (add, for example, 1).
  7. The editor closes.

Console Output:

EditorSettings: Load OK!
Loaded builtin certs
EditorSettings: Save OK!
Loading resource: res://main_menu_loop_2.ogg
Loading resource: res://main.tscn
Loading resource: res://main_menu_loop_2.ogg
Moving res://main_menu_loop_2.ogg -> res://main_menu_loop_3.ogg
Remap: res://main_menu_loop_2.ogg -> res://main_menu_loop_3.ogg
Remapping dependencies for: res://main.tscn
Loading resource: res://main.tscn
Loading resource: res://main_menu_loop_3.ogg
FileSystem: calling rescan.
FileSystem: saving moved scenes.
Loading resource: res://main_menu_loop_3.ogg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants