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

commits at source.squeak.org commits at source.squeak.org
Tue Dec 29 19:19:35 UTC 2020


Eliot Miranda uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-eem.77.mcz

==================== Summary ====================

Name: Sound-eem.77
Author: eem
Time: 29 December 2020, 11:19:33.380113 am
UUID: 6ba9cee3-631a-4b00-b66f-0aad4608aefd
Ancestors: Sound-eem.76

Allow MixedSound to do its thing even if it hasn't been sent reset and had soundDone set-up correctly.

=============== Diff against Sound-eem.76 ===============

Item was changed:
  ----- Method: MixedSound>>mixSampleCount:into:startingAt:leftVol:rightVol: (in category 'sound generation') -----
  mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: leftVol rightVol: rightVol
  	"Play a number of sounds concurrently. The level of each sound can be set independently for the left and right channels."
  
  	| snd left right |
+ 	soundDone
+ 		ifNil:
+ 			[1 to: sounds size do:
+ 				[:i |
+ 				snd := sounds at: i.
+ 				left := (leftVol * (leftVols at: i) * scaledVol / ScaleFactor) // ScaleFactor.
+ 				right := (rightVol * (rightVols at: i) * scaledVol / ScaleFactor) // ScaleFactor.
+ 				snd samplesRemaining > 0 ifTrue:
+ 					[snd mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: left rightVol: right]]]
+ 		ifNotNil:
+ 			[1 to: sounds size do:
+ 				[:i |
+ 				(soundDone at: i) ifFalse:
+ 					[snd := sounds at: i.
+ 					left := (leftVol * (leftVols at: i) * scaledVol / ScaleFactor) // ScaleFactor.
+ 					right := (rightVol * (rightVols at: i) * scaledVol / ScaleFactor) // ScaleFactor.
+ 					snd samplesRemaining > 0
+ 						ifTrue: [snd mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: left rightVol: right]
+ 						ifFalse: [soundDone at: i put: true]]]]!
- 	1 to: sounds size do: [:i |
- 		(soundDone at: i) ifFalse: [
- 			snd := sounds at: i.
- 			left := (leftVol * (leftVols at: i) * scaledVol / ScaleFactor) // ScaleFactor.
- 			right := (rightVol * (rightVols at: i) * scaledVol / ScaleFactor) // ScaleFactor.
- 			snd samplesRemaining > 0
- 				ifTrue: [
- 					snd mixSampleCount: n into: aSoundBuffer startingAt: startIndex leftVol: left rightVol: right]
- 				ifFalse: [soundDone at: i put: true]]].
- !



More information about the Squeak-dev mailing list