[squeak-dev] The Trunk: Sound-eem.72.mcz

Stéphane Rollandin lecteur at zogotounga.net
Sat Sep 19 14:32:02 UTC 2020


> Eliot Miranda uploaded a new version of Sound to project The Trunk:
> http://source.squeak.org/trunk/Sound-eem.72.mcz
> 
> ==================== Summary ====================
> 
> Name: Sound-eem.72
> Author: eem
> Time: 19 September 2020, 6:41:04.690078 am
> UUID: 993decea-486a-4d07-badb-dda290a3194e
> Ancestors: Sound-ct.71
> 
> Fix an annopying behaviour in MixedSound.  If the same SampledSound is added more than once to a MixedSound then mix-down will produce weird results.  Fix by checking for duplicates in MixedSound>>add:pan:volume: and silently taking a copy.  Levente, if this is the wrong approach LMK and I can commit a version that raises an error instead.

Actually there is another conceptual problem with 
MixedSound>>add:pan:volume:

It does not check whether the added sound is mono or stereo.

As a consequence, when using MixedSound>>add: (which applies a pan of 
0.5) with a stereo sound as argument, that sound overall volume gets 
decreased because the corresponding leftVols and rightVols values are 
set to obey the pan law.

But I would expect the values added to leftVols and rightVols to be 
ScaleFactor so that the newly added sound is mixed as is, with no change 
in volume.

To see (well, hear) the problem, use the attached stereo sound as follow:

	snd := SampledSound fromWaveFileNamed: 'sound.wav'.

	ms := MixedSound new.
	ms add: snd.

	snd play. "correct volume"
	ms play. "lower volume"

Stef
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sound.wav
Type: audio/wav
Size: 335132 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200919/3d343a9c/attachment-0001.bin>


More information about the Squeak-dev mailing list