annotate examples/sound/sampled/play2.scm @ 0:bf79fb79ee13

Initial Mercurial check in.
author samer
date Tue, 17 Jan 2012 17:50:20 +0000
parents
children
rev   line source
samer@0 1 (load "audio.scm")
samer@0 2
samer@0 3 (define fmt (stereo 44100)) ; see audio.scm for other options
samer@0 4
samer@0 5 (define in (linesrc fmt))
samer@0 6 (define out (linesnk fmt))
samer@0 7 (define N 2048) ; frame size for audio transfers
samer@0 8 (define x (VVector. "x" N)) ; frame of audio data
samer@0 9
samer@0 10 ; this sets up the tasks to run in the main loop, but
samer@0 11 ; nothing happens until the loop is started
samer@0 12 (addtasks
samer@0 13 (.reader in (.array x) 0 N) ; read N samples into x
samer@0 14 (switch (.writer out (.array x) 0 N))
samer@0 15 )
samer@0 16