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

Output Stereo #67

Open
ytsrt66589 opened this issue Dec 27, 2024 · 3 comments
Open

Output Stereo #67

ytsrt66589 opened this issue Dec 27, 2024 · 3 comments

Comments

@ytsrt66589
Copy link

Thanks for your amazing package!

I'm currently trying to use this package to align my multi-tracks audio with its mixture. However, I face the problem that the output file for mixture is always mono. Is that possible to keep the mixture be stereo?

Thanks a lot.

@iver56
Copy link

iver56 commented Dec 27, 2024

Here's a workaround: If you install fast-align-audio and get the offset (which denotes the amount of samples the delayed_signal is delayed compared to the reference signal) from audalign, you can align your mixture (and keep it in stereo) like this:

aligned_audio, gaps = fast_align_audio.align_delayed_signal_with_reference(
    reference, delayed, offset=offset
)

@benfmiller
Copy link
Owner

Thank you @ytsrt66589 for raising this issue, and thank you @iver56 for the workaround!

This can also be done through the _write_shifted_files method https://github.com/benfmiller/audalign/blob/main/audalign/__init__.py#L624 .

I think this functionality should also be present to the align methods, so I'll add support for the unprocessed flag there

@mmathis76
Copy link

mmathis76 commented Jan 31, 2025

Hi Ben,

Thank you for Audalign which seems to be a great help in aligning tracks recorded with multiple recorders (thus having to deal with alignment and clock drift issues).

I have the same issue with my stereo input files which are aligned correctly but also down-mixed to mono in the process.

Let's assume this is my script. How would I have to use _write_shifted_files to preserve stereo output?

import audalign as ad

fingerprint_rec = ad.FingerprintRecognizer()

fingerprint_rec.config.set_accuracy(3)

results = ad.align("target/folder/", recognizer=fingerprint_rec)

results = ad.align_files(
    "bak/sample1.wav",
    "bak/sample2.wav",
    destination_path="destination/",
    recognizer=fingerprint_rec
)

Thanks in advance for your help. This looks like a fantastic tool for live archivists and field recordists.

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

4 participants