rename to audio

pull/2088/head
Hui Zhang 3 years ago
parent e1e1dd6356
commit f94cb4832b

3
audio/.gitignore vendored

@ -0,0 +1,3 @@
build
third_party/archives/
third_party/install/

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(paddleaudio)
project(paddlespeech)
# check and set CMAKE_CXX_STANDARD
string(FIND "${CMAKE_CXX_FLAGS}" "-std=c++" env_cxx_standard)
@ -14,4 +14,4 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
option(BUILD_SOX "Build libsox statically" ON)
add_subdirectory(third_party)
add_subdirectory(paddleaudio/csrc)
add_subdirectory(audio/csrc)

@ -4,7 +4,7 @@ find_package(pybind11 CONFIG)
function(define_extension name sources libraries)
add_library(${name} SHARED ${sources})
target_include_directories(
${name} PRIVATE ${PROJECT_SOURCE_DIR} ${Python3_INCLUDE_DIRS} ${pybind11_INCLUDE_DIR})
${name} PRIVATE ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${Python3_INCLUDE_DIRS} ${pybind11_INCLUDE_DIR})
target_link_libraries(${name} ${libraries})
set_target_properties(${name} PROPERTIES PREFIX "")
install(

@ -0,0 +1,8 @@
#include "pybind/sox/io.h"
PYBIND11_MODULE(_paddleaudio, m) {
m.def("get_info_file", &paddleaudio::sox_io::get_info_file,
"Get metadata of audio file.");
m.def("get_info_fileobj", &paddleaudio::sox_io::get_info_fileobj,
"Get metadata of audio in file object.");
}

@ -1,19 +1,5 @@
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <paddleaudio/csrc/pybind/sox/io.h>
#include <paddleaudio/csrc/pybind/sox/utils.h>
#include "pybind/sox/io.h"
#include "pybind/sox/utils.h"
using namespace paddleaudio::sox_utils;

@ -0,0 +1,18 @@
#ifndef PADDLEAUDIO_PYBIND_SOX_IO_H
#define PADDLEAUDIO_PYBIND_SOX_IO_H
#include "pybind/sox/utils.h"
namespace paddleaudio {
namespace sox_io {
auto get_info_file(const std::string &path, const std::string &format)
-> std::tuple<int64_t, int64_t, int64_t, int64_t, std::string>;
auto get_info_fileobj(py::object fileobj, const std::string &format)
-> std::tuple<int64_t, int64_t, int64_t, int64_t, std::string>;
} // namespace paddleaudio
} // namespace sox_io
#endif

@ -1,18 +1,4 @@
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <paddleaudio/csrc/pybind/sox/utils.h>
#include "pybind/sox/utils.h"
#include <sstream>

@ -1,17 +1,3 @@
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PADDLEAUDIO_PYBIND_SOX_UTILS_H
#define PADDLEAUDIO_PYBIND_SOX_UTILS_H

@ -1,22 +0,0 @@
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <paddleaudio/csrc/pybind/sox/io.h>
PYBIND11_MODULE(_paddleaudio, m) {
m.def("get_info_file", &paddleaudio::sox_io::get_info_file,
"Get metadata of audio file.");
m.def("get_info_fileobj", &paddleaudio::sox_io::get_info_fileobj,
"Get metadata of audio in file object.");
}

@ -1,32 +0,0 @@
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PADDLEAUDIO_PYBIND_SOX_IO_H
#define PADDLEAUDIO_PYBIND_SOX_IO_H
#include <paddleaudio/csrc/pybind/sox/utils.h>
namespace paddleaudio {
namespace sox_io {
auto get_info_file(const std::string &path, const std::string &format)
-> std::tuple<int64_t, int64_t, int64_t, int64_t, std::string>;
auto get_info_fileobj(py::object fileobj, const std::string &format)
-> std::tuple<int64_t, int64_t, int64_t, int64_t, std::string>;
} // namespace paddleaudio
} // namespace sox_io
#endif
Loading…
Cancel
Save