Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

Synth.StreamAudio

Description

Read audio chunks over time, concatenate them, and stream to an audio player. The reason is that sox, by itself, wants to concatenate all its audio files immediately, but I have to actually stream them if I want to overlap playing with generation.

Synopsis

Documentation

streamInTime :: Handle -> Audio.AudioIO Config.SamplingRate 2 -> IO.IO () Source #

Write samples to the handle, stay a short distance ahead of real-time, in case the the stream is still being rendered.

The wait time always winds up being negative though, probably because sox blocks stdin, so the waiting is probably unnecessary. Still I might as well keep it since I have it, and sox's behaviour might not be guaranteed anyway.