A new version of Sound was added to project Etoys Inbox: http://source.squeak.org/etoysinbox/Sound-kfr.23.mcz
==================== Summary ====================
Name: Sound-kfr.23 Author: kfr Time: 23 February 2012, 4:32:48 pm UUID: 0c62a595-a9df-1941-b595-0195b44bc759 Ancestors: Sound-kfr.22
Use left and right sound volume, as integers.
=============== Diff against Sound-kfr.22 ===============
Item was changed: ----- Method: AbstractSound>>playSampleCount:into:startingAt: (in category 'playing') ----- playSampleCount: n into: aSoundBuffer startingAt: startIndex "Mix the next n samples of this sound into the given buffer starting at the given index. Update the receiver's control parameters periodically."
| fullVol samplesBetweenControlUpdates pastEnd i remainingSamples count | + fullVol := (AbstractSound scaleFactor * SoundPlayer soundVolume) rounded . - fullVol := AbstractSound scaleFactor * SoundPlayer soundVolume average. samplesBetweenControlUpdates _ self samplingRate // self controlRate. pastEnd _ startIndex + n. "index just after the last sample" i _ startIndex. [i < pastEnd] whileTrue: [ remainingSamples _ self samplesRemaining. remainingSamples <= 0 ifTrue: [^ self]. count _ pastEnd - i. samplesUntilNextControl < count ifTrue: [count _ samplesUntilNextControl]. remainingSamples < count ifTrue: [count _ remainingSamples]. + self mixSampleCount: count into: aSoundBuffer startingAt: i leftVol: fullVol first rightVol: fullVol second. - self mixSampleCount: count into: aSoundBuffer startingAt: i leftVol: fullVol rightVol: fullVol. samplesUntilNextControl _ samplesUntilNextControl - count. samplesUntilNextControl <= 0 ifTrue: [ self doControl. samplesUntilNextControl _ samplesBetweenControlUpdates]. i _ i + count]. !
etoys-dev@lists.squeakfoundation.org