Christoph Thiede uploaded a new version of Tests to project The Trunk: http://source.squeak.org/trunk/Tests-ct.499.mcz
==================== Summary ====================
Name: Tests-ct.499 Author: ct Time: 12 October 2023, 7:04:04.688818 pm UUID: e65e949e-a834-7547-8ff0-6cbddc859574 Ancestors: Tests-mt.498
Complements Sound-ct.94 (fixes endianness issues for storing sounds).
=============== Diff against Tests-mt.498 ===============
Item was added: + ----- Method: SoundTest>>testStoreLoopedSamples (in category 'tests') ----- + testStoreLoopedSamples + + self testStoreSamplesFor: + (RepeatingSound carMotorSound: 20.0 "optimized case") sound. + self testStoreSamplesFor: + (RepeatingSound carMotorSound: 10.0) sound.!
Item was added: + ----- Method: SoundTest>>testStorePluckedSamples (in category 'tests') ----- + testStorePluckedSamples + + self testStoreSamplesFor: PluckedSound default.!
Item was changed: ----- Method: SoundTest>>testStoreSamples (in category 'tests') ----- testStoreSamples
+ self testStoreSamplesFor: + (SampledSound + samples: SampledSound coffeeCupClink + samplingRate: SoundPlayer samplingRate).! - | sound fileName arrayBytes fileBytes | - sound := PluckedSound default. - fileName := 'tempPluck.wav'. - - "Write to file" - fileBytes := [ - sound storeWAVOnFileNamed: fileName. - FileStream oldFileNamed: fileName do: [:stream | - stream binary contents]] ensure: [ - FileDirectory default deleteFileNamed: fileName]. - - "Write to array" - arrayBytes := ByteArray streamContents: [:stream | - sound storeWAVSamplesOn: stream]. - - "Compare" - self assert: fileBytes equals: arrayBytes.!
Item was added: + ----- Method: SoundTest>>testStoreSamplesFor: (in category 'tests') ----- + testStoreSamplesFor: aSound + + | fileName arrayBytes fileBytes | + fileName := '{1}.wav' format: {self selector}. + + "Write to file" + fileBytes := + [aSound storeWAVOnFileNamed: fileName. + FileStream oldFileNamed: fileName do: [:stream | + stream binary contents]] ensure: + [FileDirectory default deleteFileNamed: fileName]. + + "Write to array" + arrayBytes := ByteArray streamContents: [:stream | + aSound storeWAVSamplesOn: stream]. + + "Compare" + self assert: fileBytes equals: arrayBytes.!
packages@lists.squeakfoundation.org