[squeak-dev] How can I listen to my app?

Herbert König herbertkoenig at gmx.net
Thu Sep 11 20:29:53 UTC 2014


Hey, got too curious myself.

Here's a snippet I found in a Workspace. AudioSample data was just a 
class of mine which could create diverse audio samples used for 
measurements.
All was done in 3.8.

dats := AudioSampleData multiSineArray asFloatArray.
dats /= dats max. dats *= 32000.
nd := Array new: dats size * 2.
dats withIndexDo: [:ea :ind| nd at: 2* ind put: ea asInteger; at: 2 * 
ind - 1 put: ea asInteger].
ss := (SampledSound new setSamples: nd  samplingRate: 48000)
ss play. ss duration
dats:= nil. nd:= nil. ss := nil.
SoundPlayer stopReverb
SoundPlayer shutDown

Here's one writing a wav file:
success ifTrue:
         [(SampledSound samples: inputData samplingRate: sampleRate)
             storeWAVOnFileNamed: anotherString.]

Hope that helps a bit.

Cheers, Herbert


More information about the Squeak-dev mailing list