WaveBeans / wavebeans

Audio Processing. On scale.
https://wavebeans.io
Apache License 2.0
24 stars 0 forks source link

Output to support partial flush #86

Closed asubb closed 3 years ago

asubb commented 3 years ago

Some outputs may support flushing the file earlier and starting another one as per request or some other event.

As the event should be bypassed as a part of the stream, the wrapper Managed is introduced. The Managed allows to specify the signal and data at the same time, and hence react accordingly.

data class Managed<S, T> (
  val signal: S?,
  val data: T?
)

For the output, the signal Flush would be introduced:

typealias OutputSignal Int

const val FlushSignal = 0x01

As long as the output gets the FlushSignal it flushes the current written buffer and starts the new buffer over.

Output should support the name generation strategies or use default ones.

The current candidates to support flush are wav, csv and dev-null outputs.