effects.h 741 Bytes
Newer Older
1
2
3
#ifndef TORCHAUDIO_SOX_EFFECTS_H
#define TORCHAUDIO_SOX_EFFECTS_H

4
#include <libtorchaudio/sox/utils.h>
5
6
#include <torch/script.h>

Moto Hira's avatar
Moto Hira committed
7
namespace torchaudio::sox {
8
9
10
11
12

void initialize_sox_effects();

void shutdown_sox_effects();

hwangjeff's avatar
hwangjeff committed
13
auto apply_effects_tensor(
14
15
    torch::Tensor waveform,
    int64_t sample_rate,
hwangjeff's avatar
hwangjeff committed
16
17
    const std::vector<std::vector<std::string>>& effects,
    bool channels_first) -> std::tuple<torch::Tensor, int64_t>;
moto's avatar
moto committed
18

hwangjeff's avatar
hwangjeff committed
19
20
21
auto apply_effects_file(
    const std::string& path,
    const std::vector<std::vector<std::string>>& effects,
22
23
24
    std::optional<bool> normalize,
    std::optional<bool> channels_first,
    const std::optional<std::string>& format)
25
    -> std::tuple<torch::Tensor, int64_t>;
26

Moto Hira's avatar
Moto Hira committed
27
} // namespace torchaudio::sox
28
29

#endif