Julius: Cutscene video volume control

Created on 31 Jan 2019  路  10Comments  路  Source: bvschaik/julius

I tend to play with the sound settings at 50% so that I have some control over the game volume relative to other apps running simultaneously on my PC. There is no way to control the volume of the videos that play (Caesar requests, Barbarians attack, etc).

Reproduce this by setting all the volume settings to 5% (or even 0), then wait for a Caesar request and you'll hear it at full volume. To be fair, the original game had the same issue, but it's really annoying. Is it possible to make the video volume into one of the existing categories (Music, Speech, Sound Effects, City Sounds)?

Most helpful comment

Sound effects please.

All 10 comments

I agree with this feature, that loud music can be annoying.

Also I would use the "Music volume" setting to determine the video volume.

Good idea. Right now the video's sound is not played if Sound Effects are off (same as C3). Maybe we should use that setting?

I briefly looked into this yesterday: video sound is played using a custom music player in SDL. To change the volume, we need to change the volume of the music data somewhere in platform/sound_device.c:next_audio_frame(). It looks like we can use SDL_MixAudioFormat() for that, but I'm not too familiar with SDL and audio, so if anyone wants to pick this up I'd be grateful.

Since I already messed around with libsmacker I'll try to do it.

@crudelios: I didn't see that you are working on that because i am as well :)

My investigations so far: Like @bvschaik already pointed out that the custom player is used.
I focused on video.c where next_audio_frame() extracts the next blob that gets played. I tried to find out what format the audio is within the smk files and played with SDL_MixAudioFormat(). Turned out that no AudioFormat prepared by SDL is working on this stream. However the audio stream seems to be simple 8 bit that can be scaled with any factor to reduce the volume.

Currently i'm working on a pull request for this.

@siredmar Wouldn't it be better to let SDL_MixAudioFormat do its job in sound_device.c where the audio is converted to SDL format, rather than manually downscaling 8-bit audio?

@siredmar I hadn't started yet so no work duplicated :)

I agree that this should fall under "Sound Effects". If the on/off works on it, then it makes the most sense.

What shall it be? Music volume or Sound effects volume?
I tend to the sound effects volume setting

Sound effects please.

Please see pull request #81

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ArtySh0ck picture ArtySh0ck  路  3Comments

Uberwire picture Uberwire  路  5Comments

bvschaik picture bvschaik  路  7Comments

mirh picture mirh  路  9Comments

jdmillard picture jdmillard  路  7Comments