@@ 27,6 27,7 @@ structure AudioFileReadStream : sig
} * BqAudioReadStream.t -> stream
val error : stream -> string option
+ val finish : stream -> unit
end = struct
@@ 63,6 64,11 @@ structure AudioFileReadStream : sig
fun error ({ error, ... } : stream) = error
+ fun finish ( { finish, ... } : stream) =
+ case ! finish of
+ NONE => ()
+ | SOME f => (finish := NONE; f ())
+
fun read ({ upstream = ref NONE, ... } : stream, _) = NONE
| read ({ upstream, rate, channels, position,
filename, finish, error } : stream,