uiua-lang / uiua

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

Automatically resample decoded audio #526

Closed yanqui-uxo closed 1 month ago

yanqui-uxo commented 1 month 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 1 month ago

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

kaikalii commented 1 month ago

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

kaikalii commented 1 month 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.