Skip to content
This repository was archived by the owner on Mar 22, 2025. It is now read-only.
This repository was archived by the owner on Mar 22, 2025. It is now read-only.

Block times type is too restrictive #34

Open
@jpsamaroo

Description

@jpsamaroo

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 Blocks 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions