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

Question about concatenate afpk files #93

Open
NahuBocco opened this issue Jan 4, 2023 · 2 comments
Open

Question about concatenate afpk files #93

NahuBocco opened this issue Jan 4, 2023 · 2 comments

Comments

@NahuBocco
Copy link

Hi @dpwe , first of all, congratz for this awsome tool for python.

I have question:
Supouse that i have two afpk files of A.wav and B.wav, where A and B are consecutive audio chunks in time.
Then, afpk files contains

A.afpk -> audfprintpeakV00--bytes of afpk A--
B.afpk -> audfprintpeakV00--bytes of afpk B--

If i concatenate the data inside the files in this way:
AB.afpk -> audfprintpeakV00--bytes of afpk A----bytes of afpk B--

This is equivalent to afpk extracted from A.wav concatenated with B.wav ?

@dpwe
Copy link
Owner

dpwe commented Jan 4, 2023

Sadly no, I think. Each peak is recorded as a (time index, bin index) pair, and the time indices are absolute (and maybe assumed monotonic). If you appended the wav files, B would begin at a time corresponding to the end of A, whereas B analyzed alone will begin at time zero.

You could modify the afpk format to write (delta-from-previous-time, bin), and then re-accumulate the times when reading back. Then it would probably work.

@NahuBocco
Copy link
Author

Oh okay, probably ill make a function to "merge" afpks that take as arggument the offstet time between recorded files
Thank you very much, I really appreciate your answer!

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

No branches or pull requests

2 participants