uiua-lang / uiua

A stack-based array programming language
https://www.uiua.org
MIT License
1.62k stars 117 forks source link

Automatically resample decoded audio #526

Closed yanqui-uxo closed 4 months ago

yanqui-uxo commented 4 months ago

I noticed that when I decoded and attempted to play audio from a .wav file that had a different sample rate than what was used by Uiua, it sounded sped up. I propose that Uiua automatically resample the decoded audio to match the sample rate used. I am willing to make a pull request if this is agreeable.

kaikalii commented 4 months ago

I could have sworn I accounted for this. Do you have somewhere I can get the offending audio file?

kaikalii commented 4 months ago

Actually, the reason for this bug makes sense. Yes, I would accept a PR.

kaikalii commented 4 months ago

It's also possible that un &ae could return the sample rate. That way, you could resample it manually with keep. It also would prevent you from mucking up the data by resampling when you don't need to.