| 1 | #include "api_cpp2py_export.h" |
| 2 | |
| 3 | WavFileWrapper WavFileWrapper::load_wav_file(const char *filename) { |
| 4 | std::vector<float> pcmf32; |
| 5 | std::vector<std::vector<float>> pcmf32s; |
| 6 | if (!::read_wav(filename, pcmf32, pcmf32s, false)) { |
| 7 | throw std::runtime_error("Failed to load wav file"); |
| 8 | } |
| 9 | return WavFileWrapper(&pcmf32, &pcmf32s); |
| 10 | } |
| 11 | |
| 12 | namespace py = pybind11; |
| 13 | using namespace pybind11::literals; |