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

Wavbrro integration #66

Merged
merged 2 commits into from
Nov 6, 2023
Merged

Wavbrro integration #66

merged 2 commits into from
Nov 6, 2023

Conversation

cjrolo
Copy link
Collaborator

@cjrolo cjrolo commented Nov 3, 2023

This PR integrates the WAVBRRO format into the compressor.

Also refactored the integration tests to now run against the new format.
As expected, the nasty decompression bug to the wav format is gone with the new format.

let compressed_data = compress_data(&data, arguments);

//write
file_path.set_extension("bro");
Copy link
Contributor

@rukai rukai Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is bro supposed to indicate compressed while wbro indicates uncompressed?
Can we pick a name that indicates this better?
Maybe .compressed.bro/.uncompressed.bro or .bro.compressed/.bro.uncompressed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming is the worst part of this project. BRO is compressed, WBRO is because it is a WAV format adaptation for BRO. But any and all suggestions around naming are very very welcome!

@@ -57,6 +57,14 @@ impl WavBrro {
self.chunks.push(Vec::with_capacity(MAX_CHUNK_SIZE));
}

// Receives a slice of f64 and writes in it's internal structure
fn load_slice(&mut self, data: &[f64]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a constructor instead, dealing with mutable state is tricky:

fn from_slice(data: &[f64) -> Self

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree. I found that and was waiting for your feedback. I'll move this into a constructor.

Copy link
Contributor

@rukai rukai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving so you can land once the feedback is considered.

@rukai rukai requested a review from Daniil-Golikov November 6, 2023 00:36
Copy link
Contributor

@Daniil-Golikov Daniil-Golikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed at the meeting with Carlos, WavBrro and bro_reader now have different behaviors for files of the wrong type: WavBrro panics, while bro_reader skips them. This needs to be fixed in the next pull request (PR). I can take care of it.

Otherwise, I agree with the previous feedback.

Also, it now seems to me that we have a mess with naming conventions: 'bro_reader' uses snake_case, while 'WavBrro' uses PascalCase.

This makes sense since WavBrro is OOP, but bro_reader is not. So, it seems to me that in the next PR, it might be worth rewriting bro_reader in an OOP style?

@joshuabvarghese joshuabvarghese merged commit 3675d82 into main Nov 6, 2023
2 checks passed
@cjrolo cjrolo deleted the wavbrro-integration branch January 10, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants