PB 6.10 - quiet sound

Just starting out? Need help? Post your questions and find answers here.
User_Russian
Addict
Addict
Posts: 1582
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

PB 6.10 - quiet sound

Post by User_Russian »

Code (tested in Windows x64).

Code: Select all

If InitSound() = 0
  MessageRequester("Error", "Sound system is not available",  0)
  End
EndIf

SoundFileName$ = OpenFileRequester("Choose a .wav file", "", "Wave files|*.wav",0)
If SoundFileName$
  If LoadSound(0, SoundFileName$)
    PlaySound(0, #PB_Sound_Loop)
    MessageRequester("Sound", "Playing the sound (loop)..."+#LF$+"Click to quit..", 0)
  Else
    MessageRequester("Error", "Can't load the sound.", 0)
  EndIf
EndIf
End
In PB 6.10 and next versions the sound is very quiet and hard to hear and it is necessary to increase the system volume in Windows.
It's probably because miniaudio, but how to fix this and make the sound louder?

I tested low level APIs from miniaudio (functions ma_device_config_init(), ma_device_init() etc.) and the sound is just as quiet. How to make it louder like versions before PB 6.10?
BarryG
Addict
Addict
Posts: 4218
Joined: Thu Apr 18, 2019 8:17 am

Re: PB 6.10 - quiet sound

Post by BarryG »

Can't help you, but I do want to remind that you can't rely on InitSound() to test for a valid sound device -> viewtopic.php?p=640641

Even Fred confirms that in the topic I linked to -> viewtopic.php?p=640582#p640582
User_Russian
Addict
Addict
Posts: 1582
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: PB 6.10 - quiet sound

Post by User_Russian »

I don't rely on InitSound().
The problem is low volume level, in PB 6.10 and later versions, when using the miniaudio library.
In version 6.04 and previous, the volume is at a normal level.
In PB 6.10 volume is 3 times less than in PB 6.04.
My question is how to increase the volume level in miniaudio library?
firace
Addict
Addict
Posts: 947
Joined: Wed Nov 09, 2011 8:58 am

Re: PB 6.10 - quiet sound

Post by firace »

According to ChatGPT, this is due to some volume normalisation applied by miniaudio.
As a quick fix, it suggests to try this:

SoundVolume(#PB_All, 2.0)
User_Russian
Addict
Addict
Posts: 1582
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: PB 6.10 - quiet sound

Post by User_Russian »

firace wrote: Mon Sep 15, 2025 3:14 amSoundVolume(#PB_All, 2.0)
Then the sound is not heard at all.
Volume.f - The new volume for the sound. Valid values are from 0 (no volume) to 100 (full volume).
The value 200 is invalid and the debugger stops the application.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4991
Joined: Sun Apr 12, 2009 6:27 am

Re: PB 6.10 - quiet sound

Post by RASHAD »

Hi
If you didn't do the next tip then do it :)
1- Go to System -> Sound
2- More sound settings
3- The output device Properties
4- Enhancement
4- Select Equalizer and Loudness Equalization
Egypt my love
User_Russian
Addict
Addict
Posts: 1582
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: PB 6.10 - quiet sound

Post by User_Russian »

firace wrote: Mon Sep 15, 2025 3:14 amAccording to ChatGPT, this is due to some volume normalisation applied by miniaudio.
Google wrote that miniaudio does not support normalisation.
Image
RASHAD wrote: Mon Sep 15, 2025 11:25 am4- Select Equalizer and Loudness Equalization
Maybe "Realtek Audio" does not support this feature because this tab is missing from the window.
Post Reply