io.h 1.06 KB
Newer Older
moto's avatar
moto committed
1
2
3
#ifndef TORCHAUDIO_SOX_IO_H
#define TORCHAUDIO_SOX_IO_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

hwangjeff's avatar
hwangjeff committed
9
auto get_effects(
10
11
    const std::optional<int64_t>& frame_offset,
    const std::optional<int64_t>& num_frames)
hwangjeff's avatar
hwangjeff committed
12
    -> std::vector<std::vector<std::string>>;
13

14
std::tuple<int64_t, int64_t, int64_t, int64_t, std::string> get_info_file(
15
    const std::string& path,
16
    const std::optional<std::string>& format);
moto's avatar
moto committed
17

18
std::tuple<torch::Tensor, int64_t> load_audio_file(
moto's avatar
moto committed
19
    const std::string& path,
20
21
22
23
24
    const std::optional<int64_t>& frame_offset,
    const std::optional<int64_t>& num_frames,
    std::optional<bool> normalize,
    std::optional<bool> channels_first,
    const std::optional<std::string>& format);
25

26
void save_audio_file(
27
28
29
30
    const std::string& path,
    torch::Tensor tensor,
    int64_t sample_rate,
    bool channels_first,
31
32
33
34
    std::optional<double> compression,
    std::optional<std::string> format,
    std::optional<std::string> encoding,
    std::optional<int64_t> bits_per_sample);
35

Moto Hira's avatar
Moto Hira committed
36
} // namespace torchaudio::sox
moto's avatar
moto committed
37
38

#endif