-instance Frame fr ⇒ Writable (Player fr Mono) (Lazy.Vector fr) where
- write pl v
- = liftIO $ sanitizeIOError $ Lazy.hPut (plHandle pl) v
+instance Stream (Player fr ch) where
+ streamSampleRate = plRate
+
+instance Frame fr ⇒ WritableStream (Player fr Mono) (L.Vector fr) where
+ writeFrames pl v
+ = liftIO $
+ sanitizeIOError $
+ do L.hPut (plHandle pl) v
+ hFlush (plHandle pl)
+
+instance Frame fr ⇒ WritableStream (Player fr Stereo) (L.Vector fr, L.Vector fr) where
+ writeFrames pl (l, r)
+ = liftIO $
+ sanitizeIOError $
+ do L.hPut (plHandle pl) (interleave l r)
+ hFlush (plHandle pl)