sergree / matchering

🎚️ Open Source Audio Matching and Mastering
https://pypi.org/project/matchering/
GNU General Public License v3.0
1.29k stars 151 forks source link

It not work with aws s3 #52

Closed SurajPysquad closed 4 months ago

SurajPysquad commented 11 months ago

we have use aws S3 on production and this library not work with

sergree commented 11 months ago

Personally, I can't help with AWS, it doesn't work in my country. Maybe there's someone here who can help.

McKean commented 5 months ago

@SurajPysquad you will have to download the files from S3. Depending on your implementation you can keep the data in ram or store it in a local temp directory. So you'll have something along these lines:

s3 = boto3.client("s3", **s3ClientConfig)
with open(f"{tmpDir}target.wav", "wb") as f:
    s3.download_fileobj(body["target"]["bucket"], body["target"]["key"], f)

with open(f"{tmpDir}reference.wav", "wb") as f:
    s3.download_fileobj(body["reference"]["bucket"], body["reference"]["key"], f)

There should be plenty of examples that show how to use s3 to download files. Once you have the files downloaded you can use matchering.process(...) to work the magic of this project. Good luck!

SurajPysquad commented 4 months ago

@McKean Thank you