Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add support for TextGrid files in binary format #242

Open
2 tasks
NickleDave opened this issue Mar 26, 2023 · 0 comments
Open
2 tasks

ENH: Add support for TextGrid files in binary format #242

NickleDave opened this issue Mar 26, 2023 · 0 comments
Assignees
Labels

Comments

@NickleDave
Copy link
Collaborator

We can parse TextGrid files saved in text but not binary format.
I do find some implementations that handle binary but looks like it might require some careful thinking about how to handle edge cases of low-level stuff I don't know well.

# Header
b'ooBinaryFile\x08TextGrid'         # where \x08 = len('TextGrid')
grid_xmin : double
grid_xmax : double
exists : bool
tiers : int

# Per Tier
str_len : byte
tier_type : str_len * byte
str_len : int
tier_name : str_len * byte
(tier_xmin : double)                 # discarded
(tier_xmax : double)                 # discarded
elements : int

# Per Point
xpos : double
str_len : short
str_len != -1:
    text : str_len * byte
else:
    # discard the -1
    str_len : short
    text : str_len * byte

# Per Interval
xmin : double
xmax : double
srt_len : short
str_len != -1:
    text : str_len * Byte
else:
    # discard the -1
    str_len short
    text : str_len * Byte

@NickleDave NickleDave self-assigned this Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant