言語ゲーム

とあるエンジニアが嘘ばかり書く日記

Twitter: @propella

マイクの高さと大きさをリアルタイム表示

buf count mic
mic _ SoundInputStream new samplingRate: 22050; startRecording. (InfoStringMorph on: [count _ 0. [mic bufferCount > 2] whileTrue: [mic nextBufferOrNil]. mic bufferCount = 2 ifTrue: [ buf _ mic nextBufferOrNil , mic nextBufferOrNil. buf inject: 0 into: [:prev :next | prev * next < 0 ifTrue: [count _ count + 1]. next]. mic meterLevel asString , ' | ' , count asString]]) openInHand

録音プロセスは SoundRecorder>>recordLoop を実行している。