"vscode:/vscode.git/clone" did not exist on "8a16e12f3a7f10d124b26aeb7975cd2bf4a81695"
Commit 789adf07 authored by Moto Hira's avatar Moto Hira Committed by Facebook GitHub Bot
Browse files

Refactor sox pybind source code (#2636)

Summary:
Pull Request resolved: https://github.com/pytorch/audio/pull/2636

At the early stage of torchaudio extension module,
`torchaudio/csrc/pybind` directory was created so that
all the code defining Python interface would be placed
there and there will be only one extension module called
`torchaudio._torchaudio`.

However, the codebase has been evolved in a way separate
extensions are defined for each feature (third party
dependency) for the sake of more moduler file organization.

What is left in `csrc/pybind` is libsox Python bindings.
This commit moves it under `csrc/sox`.

Follow-up rename `torchaudio._torchaudio` to `torchaudio._torchaudio_sox`.

Reviewed By: carolineechen

Differential Revision: D38829253

fbshipit-source-id: 3554af45a2beb0f902810c5548751264e093f28d
parent 0b7f2fba
......@@ -163,12 +163,13 @@ if(USE_FFMPEG)
endif()
################################################################################
# TODO: Rename this to _torchaudio_sox.so
# _torchaudio.so
################################################################################
if (BUILD_TORCHAUDIO_PYTHON_EXTENSION)
set(
EXTENSION_SOURCES
pybind/pybind.cpp
sox/pybind/pybind.cpp
)
#----------------------------------------------------------------------------#
# START OF CUSTOMIZATION LOGICS
......@@ -177,10 +178,10 @@ if (BUILD_TORCHAUDIO_PYTHON_EXTENSION)
list(
APPEND
EXTENSION_SOURCES
pybind/sox/effects.cpp
pybind/sox/effects_chain.cpp
pybind/sox/io.cpp
pybind/sox/utils.cpp
sox/pybind/effects.cpp
sox/pybind/effects_chain.cpp
sox/pybind/io.cpp
sox/pybind/utils.cpp
)
endif()
#----------------------------------------------------------------------------#
......
#include <torchaudio/csrc/pybind/sox/effects.h>
#include <torchaudio/csrc/pybind/sox/effects_chain.h>
#include <torchaudio/csrc/pybind/sox/utils.h>
#include <torchaudio/csrc/sox/pybind/effects.h>
#include <torchaudio/csrc/sox/pybind/effects_chain.h>
#include <torchaudio/csrc/sox/pybind/utils.h>
using namespace torchaudio::sox_utils;
......
#include <sox.h>
#include <torchaudio/csrc/pybind/sox/effects_chain.h>
#include <torchaudio/csrc/pybind/sox/utils.h>
#include <torchaudio/csrc/sox/pybind/effects_chain.h>
#include <torchaudio/csrc/sox/pybind/utils.h>
using namespace torchaudio::sox_utils;
......
#include <torchaudio/csrc/pybind/sox/effects.h>
#include <torchaudio/csrc/pybind/sox/effects_chain.h>
#include <torchaudio/csrc/pybind/sox/io.h>
#include <torchaudio/csrc/pybind/sox/utils.h>
#include <torchaudio/csrc/sox/io.h>
#include <torchaudio/csrc/sox/pybind/effects.h>
#include <torchaudio/csrc/sox/pybind/effects_chain.h>
#include <torchaudio/csrc/sox/pybind/io.h>
#include <torchaudio/csrc/sox/pybind/utils.h>
#include <torchaudio/csrc/sox/types.h>
#include <utility>
......
#include <torch/extension.h>
#ifdef INCLUDE_SOX
#include <torchaudio/csrc/pybind/sox/effects.h>
#include <torchaudio/csrc/pybind/sox/io.h>
#include <torchaudio/csrc/sox/pybind/effects.h>
#include <torchaudio/csrc/sox/pybind/io.h>
#endif
PYBIND11_MODULE(_torchaudio, m) {
......
#include <torchaudio/csrc/pybind/sox/utils.h>
#include <torchaudio/csrc/sox/pybind/utils.h>
namespace torchaudio::sox_utils {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment