diff 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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/sound/sampled/play2.scm	Tue Jan 17 17:50:20 2012 +0000
@@ -0,0 +1,16 @@
+(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))
+)
+