# HG changeset patch # User Chris Cannam # Date 1356017146 0 # Node ID a6b1cc0012323bce9208b911eb646cd4a6de41cd # Parent ad5149048604812cda5655fd9fd7af6dd37974c0 Don't use framer for playback -- it's mono only diff -r ad5149048604 -r a6b1cc001232 framer.yeti --- a/framer.yeti Thu Dec 20 15:13:30 2012 +0000 +++ b/framer.yeti Thu Dec 20 15:25:46 2012 +0000 @@ -1,6 +1,11 @@ module framer; +/** + * Framer expresses a stream (or a file) as a lazy list of (possibly + * overlapping) frames of mono data. + */ + vec = load fvector; block = load block; af = load audiofile; diff -r ad5149048604 -r a6b1cc001232 playback.yeti --- a/playback.yeti Thu Dec 20 15:13:30 2012 +0000 +++ b/playback.yeti Thu Dec 20 15:25:46 2012 +0000 @@ -20,7 +20,6 @@ bb#order(ByteOrder#LITTLE_ENDIAN); sb = bb#asShortBuffer(); for [0..len-1] do i: sb#put(i, samples[i] * 32767.0); () done; - println "writing \(nb) bytes"; actual = line#write(bytes, 0, nb); ()); @@ -42,9 +41,11 @@ playStream stream = (line = open { rate = stream.sampleRate, channels = stream.channels }; blocksize = 10240; - line.play (map (ch.mixedFromInterleavedTo line.channels stream.channels) - (fr.frames blocksize stream)); - line.close()); + not stream.finished? loop + line.play [(ch.mixedFromInterleavedTo line.channels stream.channels + (stream.readInterleaved blocksize))]; + line.close(); + stream.close()); playFile filename = playStream (af.open filename);