Chris@19: Chris@93: module yetilab.stream.stream; Chris@19: Chris@19: monoStream box = Chris@21: (readAll' box = box.read (box.len - box.position); Chris@19: { Chris@19: get position () = box.position, Chris@19: get channels () = 1, Chris@19: get sampleRate () = box.rate, Chris@19: get available () = box.len - box.position, Chris@20: get finished? () = not (box.len > box.position), Chris@19: read = box.read, Chris@19: readInterleaved = box.read, Chris@19: readMono = box.read, Chris@21: readAll () = readAll' box, Chris@21: readAllInterleaved () = readAll' box, Chris@21: readAllMono () = readAll' box, Chris@20: close = box.close, Chris@19: }); Chris@19: Chris@19: stream box = Chris@21: ({ Chris@19: get position () = box.position, Chris@19: get channels () = box.channels, Chris@19: get sampleRate () = box.rate, Chris@19: get available () = box.len - box.position, Chris@20: get finished? () = not (box.len > box.position), Chris@19: read = box.read, Chris@19: readInterleaved = box.readInterleaved, Chris@19: readMono = box.readMono, Chris@21: readAll () = box.read (box.len - box.position), Chris@21: readAllInterleaved () = box.readInterleaved (box.len - box.position), Chris@21: readAllMono () = box.readMono (box.len - box.position), Chris@20: close = box.close, Chris@19: }); Chris@19: Chris@19: { monoStream, stream } Chris@19: