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

#include <torch/script.h>
moto's avatar
moto committed
5
#include <torchaudio/csrc/sox/utils.h>
6

7
8
namespace torchaudio {
namespace sox_effects {
9
10
11
12
13

void initialize_sox_effects();

void shutdown_sox_effects();

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

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

28
29
} // namespace sox_effects
} // namespace torchaudio
30
31

#endif