Chris@19
|
1
|
Chris@93
|
2 module yetilab.stream.stream;
|
Chris@19
|
3
|
Chris@19
|
4 monoStream box =
|
Chris@21
|
5 (readAll' box = box.read (box.len - box.position);
|
Chris@19
|
6 {
|
Chris@19
|
7 get position () = box.position,
|
Chris@19
|
8 get channels () = 1,
|
Chris@19
|
9 get sampleRate () = box.rate,
|
Chris@19
|
10 get available () = box.len - box.position,
|
Chris@20
|
11 get finished? () = not (box.len > box.position),
|
Chris@19
|
12 read = box.read,
|
Chris@19
|
13 readInterleaved = box.read,
|
Chris@19
|
14 readMono = box.read,
|
Chris@21
|
15 readAll () = readAll' box,
|
Chris@21
|
16 readAllInterleaved () = readAll' box,
|
Chris@21
|
17 readAllMono () = readAll' box,
|
Chris@20
|
18 close = box.close,
|
Chris@19
|
19 });
|
Chris@19
|
20
|
Chris@19
|
21 stream box =
|
Chris@21
|
22 ({
|
Chris@19
|
23 get position () = box.position,
|
Chris@19
|
24 get channels () = box.channels,
|
Chris@19
|
25 get sampleRate () = box.rate,
|
Chris@19
|
26 get available () = box.len - box.position,
|
Chris@20
|
27 get finished? () = not (box.len > box.position),
|
Chris@19
|
28 read = box.read,
|
Chris@19
|
29 readInterleaved = box.readInterleaved,
|
Chris@19
|
30 readMono = box.readMono,
|
Chris@21
|
31 readAll () = box.read (box.len - box.position),
|
Chris@21
|
32 readAllInterleaved () = box.readInterleaved (box.len - box.position),
|
Chris@21
|
33 readAllMono () = box.readMono (box.len - box.position),
|
Chris@20
|
34 close = box.close,
|
Chris@19
|
35 });
|
Chris@19
|
36
|
Chris@19
|
37 { monoStream, stream }
|
Chris@19
|
38
|