Eliot Miranda uploaded a new version of Chronology-Core to project The Trunk:
http://source.squeak.org/trunk/Chronology-Core-eem.63.mcz
==================== Summary ====================
Name: Chronology-Core-eem.63
Author: eem
Time: 2 December 2020, 11:42:13.044649 am
UUID: 713cef96-205d-4f67-95f1-cabd0bb1b3f3
Ancestors: Chronology-Core-mt.62
Nicer code for a couple of Duration methods...
I'm doing this to help me remember 5 seconds wait et al...
=============== Diff against Chronology-Core-mt.62 ===============
Item was changed:
----- Method: Duration>>asDelay (in category 'squeak protocol') -----
asDelay
+ ^Delay forMilliseconds: self asMilliSeconds
- ^ Delay forDuration: self
!
Item was changed:
----- Method: Duration>>wait (in category 'squeak protocol') -----
wait
+ "Convert this duration in a delay and wait once. Answer the created delay so that the client can wait on it again if needed."
- "Convert this duration in a delay and wait once. Return the created delay so that the client can wait on it again if needed.
+ "[3 seconds wait] timeToRun"
- Do-it: 3 minutes wait"
+ ^self asDelay wait!
- | delay |
- delay := self asDelay.
- delay wait.
- ^ delay!
Eliot Miranda uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-eem.76.mcz
==================== Summary ====================
Name: Sound-eem.76
Author: eem
Time: 1 December 2020, 4:41:34.045008 pm
UUID: bc35632b-366a-4d24-81f7-024beb3dbda7
Ancestors: Sound-eem.75
Fix a bug in SoundRecorder so that the following works:
[:r| r resumeRecording. (Delay forSeconds: 5) wait. r playback] value: SoundRecorder new
Arguably this should work too:
[:r| r startRecording. (Delay forSeconds: 5) wait. r playback] value: SoundRecorder new
i.e. startRecording should set paused to false. But this is a change in API that could affect clients so I'll oput the suggestion out there and leave it to others to judge.
=============== Diff against Sound-eem.75 ===============
Item was changed:
----- Method: SoundRecorder>>emitBuffer: (in category 'private') -----
emitBuffer: buffer
+ | sound ratio |
- | sound ratio resultBuf |
-
"since some sound recording devices cannot (or will not) record below a certain sample rate,
trim the samples down if the user really wanted fewer samples"
+ sound := (desiredSampleRate isNil or: [(ratio := samplingRate // desiredSampleRate) <= 1])
+ ifTrue: [SampledSound new setSamples: buffer samplingRate: samplingRate]
+ ifFalse:
+ [| resultBuf |
+ resultBuf := SoundBuffer
+ averageEvery: ratio
+ from: buffer
+ upTo: buffer monoSampleCount.
+ SampledSound new setSamples: resultBuf samplingRate: samplingRate / ratio].
+ recordedSound ifNil:
+ [recordedSound := SequentialSound new].
- (desiredSampleRate isNil or: [(ratio := samplingRate // desiredSampleRate) <= 1]) ifTrue: [
- sound := SampledSound new setSamples: buffer samplingRate: samplingRate.
- ] ifFalse: [
- resultBuf := SoundBuffer
- averageEvery: ratio
- from: buffer
- upTo: buffer monoSampleCount.
- sound := SampledSound new setSamples: resultBuf samplingRate: samplingRate / ratio.
- ].
-
recordedSound add: (codec ifNil: [sound] ifNotNil: [codec compressSound: sound])!