Block
times type is too restrictive #34
Description
I'm trying to setup integration with PortAudio.jl so that I can sample from my computer's microphone, which samples on the order of tens of microseconds. I've tried constructing a Block
with the times calculated based on the number of returns audio frames, however due to rounding (because DateTime
only has Millisecond
resolution), I receive an error in the Block
constructor that my times are not strictly increasing.
As a workaround, I've defined a PreciseDateTime
struct which contains a DateTime
and Nanosecond
, to provide greater specificity; unfortunately, Block
is too restrictive and does not allow passing times
with an eltype other than DateTime
.
Would it be reasonable to relax this restriction and allow any <:AbstractDateTime
instead? It would probably add some amount of complexity when mixing Block
s from multiple sources (as we then need to promote to the more precise time type), but that feels like an inevitable tradeoff when wanting to support finer time resolutions.