python-soundfile
python-soundfile copied to clipboard
Support `compression_level` for some of lossless format and `vbr` for lossy format
Hi, It seems that there's no way to set COMPRESSION_LEVEL or VBR while export except _snd.sf_command.
Is that any plan to add compression_level and vbr args to soundfile.write?
Not yet, but it's a great idea! Would you like to contribute a pull request?
Sorry for repliying after few days.
Yes, I'd like to make a pull request, but I have some issues for design these args.
compression_level and vbr args just support lossy sound format and some lossless format, and it need both in WRITE and set before write any audio data in the file.
Should we add some ‘if’ to make sure args is legal, or just send the command without any check?
(Sorry for the poor English)
I think if the command is not available, we should give an error message. We don't want to silently ignore data the user provided. It might be useful to add these parameters to the SoundFile constructor, so they are definitely applied before any read or write operations.
Do you know what these operations do in append mode? We might need to check/document/prevent that sort of usage.