提交 eead92af 编写于 作者: K KP

Add sox io.

上级 86ac7b80
...@@ -25,7 +25,8 @@ auto get_info_file(const std::string &path, const std::string &format) ...@@ -25,7 +25,8 @@ auto get_info_file(const std::string &path, const std::string &format)
SoxFormat sf(sox_open_read(path.data(), SoxFormat sf(sox_open_read(path.data(),
/*signal=*/nullptr, /*signal=*/nullptr,
/*encoding=*/nullptr, /*encoding=*/nullptr,
/*filetype=*/format.data())); /*filetype=*/format.empty() ? nullptr : format.data()));
validate_input_file(sf, path); validate_input_file(sf, path);
...@@ -54,7 +55,7 @@ auto get_info_fileobj(py::object fileobj, const std::string &format) ...@@ -54,7 +55,7 @@ auto get_info_fileobj(py::object fileobj, const std::string &format)
SoxFormat sf(sox_open_mem_read(buf, buf_size, SoxFormat sf(sox_open_mem_read(buf, buf_size,
/*signal=*/nullptr, /*signal=*/nullptr,
/*encoding=*/nullptr, /*encoding=*/nullptr,
/*filetype=*/format.data())); /*filetype=*/format.empty() ? nullptr : format.data()));
// In case of streamed data, length can be 0 // In case of streamed data, length can be 0
validate_input_memfile(sf); validate_input_memfile(sf);
......
...@@ -19,7 +19,6 @@ import pybind11 ...@@ -19,7 +19,6 @@ import pybind11
import setuptools import setuptools
from setuptools import Extension from setuptools import Extension
from setuptools.command.build_ext import build_ext from setuptools.command.build_ext import build_ext
from setuptools.command.install import install
from setuptools.command.test import test from setuptools.command.test import test
# set the version here # set the version here
...@@ -47,11 +46,6 @@ class TestCommand(test): ...@@ -47,11 +46,6 @@ class TestCommand(test):
os.system(f'pytest {benchmark_item}') os.system(f'pytest {benchmark_item}')
class InstallCommand(install):
def run(self):
install.run(self)
class ExtBuildCommand(build_ext): class ExtBuildCommand(build_ext):
def run(self): def run(self):
try: try:
...@@ -149,7 +143,6 @@ setuptools.setup( ...@@ -149,7 +143,6 @@ setuptools.setup(
}, },
ext_modules=get_ext_modules(), ext_modules=get_ext_modules(),
cmdclass={ cmdclass={
'install': InstallCommand,
"build_ext": ExtBuildCommand, "build_ext": ExtBuildCommand,
'test': TestCommand, 'test': TestCommand,
}, ) }, )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册