Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data AudioClock (rate :: AudioRate) (bufferSize :: Nat) = AudioClock
- data AudioRate
- data PureAudioClock (rate :: AudioRate) = PureAudioClock
- pureAudioClockF :: PureAudioClockF rate
Documentation
data AudioClock (rate :: AudioRate) (bufferSize :: Nat) Source #
A clock for audio analysis and synthesis.
It internally processes samples in buffers of size bufferSize
,
(the programmer does not have to worry about this),
at a sample rate of rate
(of type AudioRate
).
Both these parameters are in the type signature,
so it is not possible to compose signals with different buffer sizes
or sample rates.
After processing a buffer, the clock will wait the remaining time
until the next buffer must be processed,
using system UTC time.
The tag of the clock specifies whether the attempt to finish the last buffer in real time was successful.
A value of Nothing
represents success,
a value of Just double
represents a lag of double
seconds.
(MonadIO m, KnownNat bufferSize, AudioClockRate rate) => Clock m (AudioClock rate bufferSize) Source # | |
type TimeDomainOf (AudioClock rate bufferSize) Source # | |
type Tag (AudioClock rate bufferSize) Source # | |
data PureAudioClock (rate :: AudioRate) Source #
A side-effect free clock for audio synthesis and analysis.
The sample rate is given by rate
(of type AudioRate
).
Since this clock does not wait for the completion of buffers,
the producer or the consumer of the signal has the obligation to
synchronise the signal with the system clock, if realtime is desired.
Otherwise, the clock is also suitable e.g. for batch processing of audio files.
(Monad m, PureAudioClockRate rate) => Clock m (PureAudioClock rate) Source # | |
type TimeDomainOf (PureAudioClock rate) Source # | |
type Tag (PureAudioClock rate) Source # | |
pureAudioClockF :: PureAudioClockF rate Source #