1. 10 May, 2023 1 commit
  2. 12 Apr, 2023 2 commits
    • moto's avatar
      Allow overwrite temp data in ffmpeg test (#3263) · cc7b8bd4
      moto authored
      Summary:
      When `TORCHAUDIO_TEST_TEMP_DIR` is set,
      all the unit test temporary data are stored in the  given directory.
      Running unit tests multiple times reuses the
      directory and the temporary files from the
      previous test runs are found there.
      
      FFmpeg save test writes reference data to the
      temporary directory, but it is not given the
      overwrite flag ("-y"), so it fails in such cases.
      
      This commit fixes that.
      
      Pull Request resolved: https://github.com/pytorch/audio/pull/3263
      
      Reviewed By: hwangjeff
      
      Differential Revision: D44859003
      
      Pulled By: mthrok
      
      fbshipit-source-id: 2db92fbdec1c015455f3779e10a18f7f1146166b
      cc7b8bd4
    • moto's avatar
      Specify backend directly in test (#3262) · 563e409c
      moto authored
      Summary:
      Preparation to land https://github.com/pytorch/audio/pull/3241
      
      This commit applies patch to make the sox_io TorchScript test pass when dispatcher is enabled.
      
      Pull Request resolved: https://github.com/pytorch/audio/pull/3262
      
      Reviewed By: hwangjeff
      
      Differential Revision: D44897513
      
      Pulled By: mthrok
      
      fbshipit-source-id: 9b65f705cd02324328a2bc1c414aa4b7ca0fed32
      563e409c
  3. 05 Apr, 2023 1 commit
  4. 01 Mar, 2023 1 commit
    • Zhaoheng Ni's avatar
      Fix windows tests (#3119) · 6a4a8200
      Zhaoheng Ni authored
      Summary:
      `sox` is not available on Windows machines. Add skip decorators to the sox related tests to skip running tests on Windows.
      
      Pull Request resolved: https://github.com/pytorch/audio/pull/3119
      
      Reviewed By: mthrok
      
      Differential Revision: D43682754
      
      Pulled By: nateanl
      
      fbshipit-source-id: f69987dac8232a3569be83f096b32389bd8bda81
      6a4a8200
  5. 16 Feb, 2023 1 commit
    • hwangjeff's avatar
      Introduce I/O backend dispatcher (#3015) · b799fcd6
      hwangjeff authored
      Summary:
      Adds I/O backend dispatcher that routes I/O requests to FFmpeg, SoX, or Soundfile backend, per library availability. It allows users to specify a backend mapped to a media library, i.e. one of `["ffmpeg", "sox", "soundfile"]`, to use via keyword argument, with FFmpeg being the default. Environment variable `TORCHAUDIO_USE_BACKEND_DISPATCHER` gates enablement of the dispatcher; specifically, if `TORCHAUDIO_USE_BACKEND_DISPATCHER` is explicitly set to `1`, importing TorchAudio makes it accessible via `torchaudio.info`, `torchaudio.load`, and `torchaudio.save`.
      
      Pull Request resolved: https://github.com/pytorch/audio/pull/3015
      
      Reviewed By: mthrok
      
      Differential Revision: D43258649
      
      Pulled By: hwangjeff
      
      fbshipit-source-id: 8f12e4e56b9fa3f0814dd3fed3e1783ab23a53a1
      b799fcd6
  6. 21 Dec, 2022 1 commit
    • moto's avatar
      Extract libsox integration from libtorchaudio (#2929) · 1706a72f
      moto authored
      Summary:
      This commit makes the following changes to the C++ library organization
      - Move sox-related feature implementations from `libtorchaudio` to `libtorchaudio_sox`.
      - Remove C++ implementation of `is_sox_available` and `is_ffmpeg_available` as it is now sufficient to check the existence of `libtorchaudio_sox` and `libtorchaudio_ffmpeg` to check the availability. This makes `libtorchaudio_sox` and `libtorchaudio_ffmpeg` independent from `libtorchaudio`.
      - Move PyBind11-based bindings (`_torchaudio_sox`, `_torchaudio_ffmpeg`) into `torchaudio.lib` so that the built library structure is less cluttered.
      
      Background:
      Originally, when the `libsox` was the only C++ extension and `libtorchaudio` was supposed to contain all the C++ code.
      The things are different now. We have a bunch of C++ extensions and we need to make the code/build structure more modular.
      
      The new `libtorchaudio_sox` contains the implementations and `_torchaudio_sox` contains the PyBin11-based bindings.
      
      Pull Request resolved: https://github.com/pytorch/audio/pull/2929
      
      Reviewed By: hwangjeff
      
      Differential Revision: D42159594
      
      Pulled By: mthrok
      
      fbshipit-source-id: 1a0fbca9e4143137f6363fc001b2378ce6029aa7
      1706a72f
  7. 07 Oct, 2022 1 commit
  8. 23 Jun, 2022 1 commit
  9. 02 Jun, 2022 1 commit
  10. 31 May, 2022 1 commit
  11. 15 May, 2022 1 commit
    • John Reese's avatar
      [codemod][usort] apply import merging for fbcode (8 of 11) · d62875cc
      John Reese authored
      Summary:
      Applies new import merging and sorting from µsort v1.0.
      
      When merging imports, µsort will make a best-effort to move associated
      comments to match merged elements, but there are known limitations due to
      the diynamic nature of Python and developer tooling. These changes should
      not produce any dangerous runtime changes, but may require touch-ups to
      satisfy linters and other tooling.
      
      Note that µsort uses case-insensitive, lexicographical sorting, which
      results in a different ordering compared to isort. This provides a more
      consistent sorting order, matching the case-insensitive order used when
      sorting import statements by module name, and ensures that "frog", "FROG",
      and "Frog" always sort next to each other.
      
      For details on µsort's sorting and merging semantics, see the user guide:
      https://usort.readthedocs.io/en/stable/guide.html#sorting
      
      Reviewed By: lisroach
      
      Differential Revision: D36402214
      
      fbshipit-source-id: b641bfa9d46242188524d4ae2c44998922a62b4c
      d62875cc
  12. 23 Dec, 2021 1 commit
  13. 21 Dec, 2021 1 commit
    • moto's avatar
      Fix load behavior for 24-bit input (#2084) · 4554d242
      moto authored
      Summary:
      ## bug description
      
      When a 24 bits-par-sample audio is loaded via file-like object,
      the loaded Tensor is wrong. It was fine if the audio is loaded
      from local file.
      
      ## The cause of the bug
      
      The core of the sox's decoding mechanism is `sox_read` function,
      one of which parameter is the maximum number of samples to decode
      from the given buffer.
      
      https://fossies.org/dox/sox-14.4.2/formats_8c.html#a2a4f0194a0f919d4f38c57b81aa2c06f)]
      
      The `sox_read` function is called in what is called `drain` effect,
      callback and this callback receives output buffer and its size in
      byte. The previous implementation passed this size value as
      the argument of `sox_read` for the maximum number of samples to
      read. Since buffer size is larger than the number of samples fit in
      the buffer, `sox_read` function always consumed the entire
      buffer. (This behavior is not wrong except when the input is
      24 bits-per-sample and file-like object.)
      
      When the input is read from file-like object, inside of drain
      callback, new data are fetched via Python's `read` method and
      loaded on fixed-size memory region. The size of this memory region
      can be adjusted via `torchaudio.utils.sox_utils.set_buffer_size`,
      but the default value is 8096.
      
      If the input format is 24 bits-per-sample, the end of memory region
      does not necessarily correspond to the end of a valid sample.
      When `sox_read` consumes all the data in the buffer region, the data
      at the end introduces some unexpected values.
      This causes the aforementioned bug
      
      ## Fix
      
      Pass proper (better estimated) maximum number of samples decodable to
      `sox_read`.
      
      Pull Request resolved: https://github.com/pytorch/audio/pull/2084
      
      Reviewed By: carolineechen
      
      Differential Revision: D33236947
      
      Pulled By: mthrok
      
      fbshipit-source-id: 171d9b7945f81db54f98362a68b20f2f95bb11a4
      4554d242
  14. 27 Aug, 2021 1 commit
  15. 20 Jul, 2021 1 commit
  16. 12 Jul, 2021 1 commit
  17. 24 May, 2021 1 commit
  18. 02 Apr, 2021 1 commit
  19. 17 Mar, 2021 1 commit
  20. 15 Mar, 2021 1 commit
  21. 12 Mar, 2021 1 commit
  22. 08 Mar, 2021 1 commit
  23. 05 Mar, 2021 1 commit
  24. 02 Mar, 2021 1 commit
  25. 24 Feb, 2021 1 commit
  26. 23 Feb, 2021 1 commit
  27. 20 Feb, 2021 1 commit
  28. 19 Feb, 2021 1 commit
  29. 18 Feb, 2021 1 commit
  30. 12 Feb, 2021 1 commit
  31. 08 Feb, 2021 1 commit
  32. 04 Feb, 2021 1 commit