-
Notifications
You must be signed in to change notification settings - Fork 739
Closed
Description
We would like to add more format support to "sox_io"'s save function. Full Rate is the codec used in mobile phone system and the libsox torchaudio binds have capability to handle this format.
Steps
Implementation
- Add
GSMtoFormatenum andget_format_from_stringfunction. The expected string form is"gsm". - Add GSM branch in
get_save_encodingfunction. Similar to the case MP3, GSM does not take any encoding or bit depth option. UseSOX_ENCODING_GSM, 16for return value. - Add GSM branch in
get_precisionfunction. the return value should be 16.
Update documentation
- Update the docstring of
savefunction. (add"gsm"informatsection then at the bottom beforeNote:add some explanation from http://sox.sourceforge.net/soxformat.html (do text search"gsm"
Add test
- Add a new method
test_save_gsmtoSaveTestclass, following other method liketest_save_flac. Only parameterize thetest_mode. GSM does not supportcompression/encoding/bits_per_sample.
Building and testing locally
- Follow the CONTRIBUTING guide to set up development environment.
- Build and run test with;
BUILD_SOX=1 python setup.py develop && (cd test && pytest torchaudio_unittest/backend/sox_io/save_test.py -v --ff -k gsm )