-
Notifications
You must be signed in to change notification settings - Fork 3
Block
times type is too restrictive
#34
Comments
I certainly agree that there's no reason that the "Time" type used in Is a generalisation of Generalising the time type everywhere is certainly possible, but is probably not a small task (it requires adding type parameters in many places — at least to
Yep this is a concern. My gut reaction is to simply not support combining nodes with different time types (since this could indicate a more fundamental incompatibility — especially if permitting time-types beyond [1] In fact, I wouldn't stop at [2] Internally, each [3] It's a step in the right direction — but my concern is that it could lead to confusion, since they wouldn't be supported by the rest of this package. |
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 (becauseDateTime
only hasMillisecond
resolution), I receive an error in theBlock
constructor that my times are not strictly increasing.As a workaround, I've defined a
PreciseDateTime
struct which contains aDateTime
andNanosecond
, to provide greater specificity; unfortunately,Block
is too restrictive and does not allow passingtimes
with an eltype other thanDateTime
.Would it be reasonable to relax this restriction and allow any
<:AbstractDateTime
instead? It would probably add some amount of complexity when mixingBlock
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.The text was updated successfully, but these errors were encountered: