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

Support files greater than 4GB #30

Closed
GWBasic opened this issue Oct 22, 2023 · 2 comments · Fixed by #31
Closed

Support files greater than 4GB #30

GWBasic opened this issue Oct 22, 2023 · 2 comments · Fixed by #31
Labels
bug Something isn't working

Comments

@GWBasic
Copy link
Owner

GWBasic commented Oct 22, 2023

Currently, files that are long are truncated. (See GWBasic/soft_matrix#77 )

I've determined this is because RIFF + WAV has limitations imposed by 32-bit lengths specified in the file.

Specifically, https://docs.fileformat.com/audio/wav/ states that bytes 5-8 are the length of the file, in bytes. A 32-bit 6-channel wav that's 2 hours will be 8GB. This overflows RIFF's file length field.

In this bug: Figure out how to construct wav files that are longer than 32-bit RIFF file limits. https://www.loc.gov/preservation/digital/formats/fdd/fdd000001.shtml#notes might explain how to do this.

Note: Wave files > 4GB in length will not be supported. The reason is that there are two competing proposals to alter the wave file format, and support for these file formats in other applications is very limited. A much better approach for files > 4GB is to use an alternate file format, like AIFF.

I currently do not intend on supporting other audio file formats in wave_stream. At some point it may make sense to write a sister library called "aiff_stream," and possibly a library that allows reading and writing both.

@GWBasic GWBasic added the bug Something isn't working label Oct 22, 2023
@GWBasic GWBasic changed the title Can not handle files that exceed RIFF's 32-bit length marker Support files greater than 4GB Oct 24, 2023
@GWBasic
Copy link
Owner Author

GWBasic commented Oct 24, 2023

It looks like there are two approaches to long wave files, described at: https://gearspace.com/board/music-computers/1086321-do-you-use-rf64.html

In general, there's Wave64 and RF64. Both appear to have inconsistent support.

For the moment, I'm not going to support these.

@GWBasic
Copy link
Owner Author

GWBasic commented Oct 29, 2023

At the point, the appropriate "fix" is to return an error whenever anyone attempts to write a file larger than 4GB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant