[low volume level music/sfx problem] how to boost volume 2x ?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
TC1061
Prole
Posts: 32
Joined: Sat Oct 14, 2017 3:50 pm

Re: [low volume level music/sfx problem] how to boost volume 2x ?

Post by TC1061 »

But, when I played sound in Love2D, I noticed that the volume of one source can not exceed half the volume of the OS (as if the volume of source is divided by 2 by love2d).
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: [low volume level music/sfx problem] how to boost volume 2x ?

Post by zorg »

TC1061 wrote: Wed Oct 18, 2017 10:26 am But, when I played sound in Love2D, I noticed that the volume of one source can not exceed half the volume of the OS (as if the volume of source is divided by 2 by love2d).
I tested this myself with a perfect 440Hz sine wave, and it seems that if you play a mono sound, it will indeed not exceed half of what can be output to the OS, but playing a stereo one will reach max amplitude; bit depth doesn't change anything though.
Not sure if this is a bug or not (nor if anything löve can do about it, or if it's an openAlSoft (or even OS) issue/quirk) though.

This was my test code:

Code: Select all

	local chans = 2
	local wave = love.sound.newSoundData(44100,44100,8,chans)
	local j = 0
	for i=0,44100-1 do
		for c=1,chans do
			wave:setSample(j, math.sin(i * (440/44100) * 2 * math.pi))
			j = j+1
		end
	end
	local sound = love.audio.newSource(wave)
	sound:play()
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 47 guests