edit:
Added TinyTag as a dependency to detect audio file meta data for channels and rate to auto set those values.
TinyTag is MIT and has no external dependencies of its own
Pull request summary
This could be a solution to #358
The sample rate of audio for Sound is hard coded (it might have something to do with YTDL, Im not sure), however if you create a sound using a local file
Sound(source="my_audio.mp3")
it's possible and likely to have files with different sample rates. Ive personally run into this issue and have seen others run into it as well, and the only solution right now is to hack at the library code to change the sample rate manually.
This PR just gives Sound.rate and Sound.channels a setter on each class property. Maybe in the future I can look at pulling sample meta data from the suppled audio file, but sometimes that can even be wrong so those class properties kind of need to be able to be set.
Checklist
[x] If code changes were made then they have been tested.
[x] I have updated the documentation to reflect the changes.
[x] I have updated the changelog with a quick recap of my changes.
[x] This PR fixes an issue.
[x] This PR adds something new (e.g. new method or parameters).
[ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
[ ] This PR is not a code change (e.g. documentation, README, ...)
Im closing the other PR, I managed to mess up the other branch beyond repair lol. This is an identical PR to the one before.
edit: Added TinyTag as a dependency to detect audio file meta data for channels and rate to auto set those values. TinyTag is MIT and has no external dependencies of its own
Pull request summary
This could be a solution to #358
The sample rate of audio for Sound is hard coded (it might have something to do with YTDL, Im not sure), however if you create a sound using a local file
it's possible and likely to have files with different sample rates. Ive personally run into this issue and have seen others run into it as well, and the only solution right now is to hack at the library code to change the sample rate manually.
This PR just gives Sound.rate and Sound.channels a setter on each class property. Maybe in the future I can look at pulling sample meta data from the suppled audio file, but sometimes that can even be wrong so those class properties kind of need to be able to be set.
Checklist
Im closing the other PR, I managed to mess up the other branch beyond repair lol. This is an identical PR to the one before.