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

MP3 importer works incorrectly #75223

Open
Tracked by #76797
L2750558108 opened this issue Mar 22, 2023 · 12 comments
Open
Tracked by #76797

MP3 importer works incorrectly #75223

L2750558108 opened this issue Mar 22, 2023 · 12 comments

Comments

@L2750558108
Copy link
Contributor

Godot version

4.0 mono

System information

windows10

Issue description

The specific mp3 audio imported within the editor does not play clearly

Steps to reproduce

1.Download this audio file
tapSound.zip
2.Play using the system player
3.Play after import to Godot editor
4.Compare the sound when played twice

Minimal reproduction project

N/A

@Calinou
Copy link
Member

Calinou commented Mar 22, 2023

Information about the MP3 file:

$ ffprobe -i tapSound.mp3
Input #0, mp3, from 'tapSound.mp3':
Duration: 00:00:00.48, start: 0.023021, bitrate: 193 kb/s
Stream #0:0: Audio: mp3, 48000 Hz, stereo, fltp, 192 kb/s
Metadata:
encoder         : LAME3.99r

@rsubtil
Copy link
Contributor

rsubtil commented Mar 30, 2023

Can't reproduce on Linux and Windows (on 4.0.1). Tried listening many times to the preview when importing the file, as well as on a launched instance, and it seems to play just like I hear from the system player. Can you give more details on what is the issue and how it occurs?

@L2750558108
Copy link
Contributor Author

L2750558108 commented Apr 2, 2023

2023-04-02.15-56-15.mp4

This video may show the problem
The sound in the system player sounds crisper

@rsubtil
Copy link
Contributor

rsubtil commented Apr 2, 2023

Here are the waveforms from your video. Apart from the initial moment, both waves look identical:
image

The difference is so small that I'm not sure if this is an issue with Godot; it might be some setting in your system player that's causing this, like an equalizer. Try from another fresh media player without any custom settings (e.g. VLC) to see if it sounds the same as well.

@L2750558108
Copy link
Contributor Author

L2750558108 commented Apr 2, 2023

I checked my system player and the equalizer does not open
Could it be the problem of the wave at the initial moment?
By the way, if you check loop playback when importing, the audio played the second time in the loop will sound the same as the sound of the system player

@rsubtil
Copy link
Contributor

rsubtil commented Apr 2, 2023

By the way, if you check loop playback when importing, the audio played the second time in the loop will sound the same as the sound of the system player

I noticed it now indeed, and the second time the waveform looks like the one from the system player, so it seems like that initial bit is softer the first time.
image

I applied a "fade-in" effect on Audacity and the waveform changes to almost exactly how Godot outputs the first time, maybe something like that is being applied internally?

Peek.2023-04-02.19-14.mp4

Can you also try converting this sound to another audio format (.OGG or .WAV) to check if the same thing happens?

@L2750558108
Copy link
Contributor Author

Audio in OGG format seems to have the same problem

@rsubtil
Copy link
Contributor

rsubtil commented Apr 5, 2023

Tested this on Godot 3 and the issue isn't ocurring there.

@rsubtil
Copy link
Contributor

rsubtil commented Apr 5, 2023

Bisected to 3598d30 (#51296)

@Calinou
Copy link
Member

Calinou commented Apr 5, 2023

cc @ellenhp

This may be related to a different resampler being updated in 4.0. Cubic resampling is now used for all audio formats for greater consistency during playback.

@ellenhp
Copy link
Contributor

ellenhp commented Apr 5, 2023

This is related to the fade-in code that I was trying to fix in #71780

@ellenhp
Copy link
Contributor

ellenhp commented Apr 5, 2023

cc @ellenhp

This may be related to a different resampler being updated in 4.0. Cubic resampling is now used for all audio formats for greater consistency during playback.

Unrelated but wavs still use linear resampling as far as I know.

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

4 participants