Phobos-developers/Phobos

Weird bug that audio emitting low quality sound.

Closed this issue · 1 comments

Description

A weird bug that the unit's voice was producing low quality audio(Deep voice and in slow motion) which the cause is by using attack and decay sounds. However, the voice's quality is normal as intended if I do not use attack and decay.

I have tried several attempts such as renaming the .wav files, decreasing the number of attack/decay/voice audios on the Sounds tag.

Conditions to reproduce

Unfortunately, I am not sure how to reproduce this bug because it was random as I have never experienced this kind of issue before.

INI code

[BMIGMove]
Sounds= gradio1a gradio1b gradio1c gradio1d gradio1e gradio1f gradio1g $vbmgmoa $vbmgmob $vbmgmoc $vbmgmod $vbmgmoe gradio3a gradio3b gradio3c gradio3d gradio3e gradio3f gradio3g 
Control= random attack decay
Attack=7
Decay=7
Volume=90

Steps to reproduce

  1. Nothing. Just copy any existing aircraft sound code and replace it with your own custom voices.

...

Expected behaviour

The sound quality should be the same as from the original .wav file. With using the attack and decay sounds just like any normal aircraft voices.

Actual behaviour

Low quality output(Deep voice and in slow motion) if I use the attack and decay sounds.

Additional context

audio.bug.mp4

audio bug.zip

Inside the .zip file, it contains the .wav files that cause the bug. I have used different sounds with using attack and decay, but they worked as intended. However, I'd still like to find a way to solve this issue to avoid encountering this complicated bug and of course I want to use those voices in my mod.

Checklist

  • The issue is not introduced by Phobos or any other engine extension, such as Ares, Kratos etc.
  • The issue wasn't fixed in the most recent version of Ares/Phobos yet.
  • I agree to elaborate the details if requested and provide thorough testing if the bugfix is implemented.
  • I added a very descriptive title to this issue.
  • I used the GitHub search and read the issue list to find a similar issue and didn't find it.
  • I have attached as much information as possible (screenshots, gifs, videos, debug and exception logs, etc).

This appears to be a quirk of the audio engine, it will play any listed Sounds using the sampling rate/frequency of the first sample. Your new sounds are 48000hz and vanilla game's radio sounds are 22050hz. Because gradio1X will always be the first sound played, it will play the rest using same frequency, resulting in slowed-down playback for the 48khz ones.

Use same sampling rate across all listed sounds for a single event. Hard to say if it is a 'bug' caused by the developers taking a shortcut or an actual technical limitation. Either way, it is unlikely this will get changed in Phobos especially since a practical solution already exists.