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

rem/aufile: fix aufile_get_length calculations #1008

Merged
merged 4 commits into from
Nov 20, 2023

Conversation

larsimmisch
Copy link
Contributor

Also, aufile_prm should be const.

return af->datasize * prm->channels * prm->srate
/ 1000;
return af->datasize / prm->channels * 1000
/ prm->srate;
Copy link
Collaborator

@cspiel1 cspiel1 Nov 20, 2023

Choose a reason for hiding this comment

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

Maybe readable better and only one division:

return af->datasize * 1000 / (prm->channels * prm->srate);

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we also take the WAV header size into account?
See function aufile_set_position()!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

af->datasize is already the size of the data chunk without the header

@sreimers
Copy link
Member

A test case with a small wav file within test/data directory would be nice.

@sreimers sreimers changed the title The calculations in aufile_get_length were backwards. rem/aufile: The calculations in aufile_get_length were backwards. Nov 20, 2023
@sreimers sreimers changed the title rem/aufile: The calculations in aufile_get_length were backwards. rem/aufile: fix aufile_get_length calculations Nov 20, 2023
@sreimers sreimers changed the title rem/aufile: fix aufile_get_length calculations rem/aufile: fix aufile_get_length calculations Nov 20, 2023
test/aulength.c Outdated Show resolved Hide resolved
@sreimers
Copy link
Member

sreimers commented Nov 20, 2023

Looks like microsoft has a broken repo currently:

E: Repository 'https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease' changed its 'Origin' value from 'microsoft-ubuntu-jammy-prod jammy' to 'Pulp 3'
E: Repository 'https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease' changed its 'Label' value from 'microsoft-ubuntu-jammy-prod jammy' to ''
Error: Process completed with exit code 100.

microsoft/linux-package-repositories#96

@sreimers sreimers merged commit 8c626be into baresip:main Nov 20, 2023
35 checks passed
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.

3 participants