Mercurial > hg > may
changeset 167:463437b9e625
Rearrange and augment test data
author | Chris Cannam |
---|---|
date | Thu, 02 May 2013 09:14:56 +0100 |
parents | 6ffdf5d4dfcf |
children | 45199077b043 |
files | test/data/44100-2-16.wav test/data/8000-1-8.wav yetilab/stream/audiofile.yeti yetilab/test/data/20samples.wav yetilab/test/data/44100-2-16.wav yetilab/test/data/8000-1-8.wav |
diffstat | 6 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/yetilab/stream/audiofile.yeti Thu May 02 09:03:13 2013 +0100 +++ b/yetilab/stream/audiofile.yeti Thu May 02 09:14:56 2013 +0100 @@ -92,24 +92,29 @@ close' { aistream is ~AudioInputStream } = aistream#close(); -open name is string -> stream = +openWithReader reader ch name is 'a -> number -> string -> stream = (f = new File(name); aistream = AudioSystem#getAudioInputStream(f); format = aistream#getFormat(); len = available' { format, aistream }; // at start of stream { get position () = len - available' { aistream, format }, - get channels () = format#getChannels(), + get channels () = if ch == 0 then format#getChannels() else ch fi, get sampleRate () = format#getSampleRate(), get available () = Known (available' { aistream, format }), get finished? () = not (aistream#available() > 0), - read = read' { aistream, format }, + read = reader { aistream, format }, close () = close' { aistream }, }); +open = openWithReader read' 0; +openMono = openWithReader readMono' 1; + { - open + open, + openMono } as { - open is string -> stream + open is string -> stream, + openMono is string -> stream }