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

Initial Mercurial check in.
author samer
date Tue, 17 Jan 2012 17:50:20 +0000
parents
children
line wrap: on
line source
(load "audio.scm")

(define fmt (stereo 44100))	; see audio.scm for other options

(define in (linesrc fmt))
(define out (linesnk fmt)) 
(define N 2048)	; frame size for audio transfers
(define x (VVector. "x" N))	; frame of audio data

; this sets up the tasks to run in the main loop, but
; nothing happens until the loop is started
(addtasks
	(.reader in (.array x) 0 N)	; read N samples into x
	(switch (.writer out (.array x) 0 N))
)