| 158 | } |
| 159 | |
| 160 | static litert::Options create_cpu_options(size_t num_threads, uint32_t xnnpack_flags) { |
| 161 | auto options = get_litert_value(litert::Options::Create()); |
| 162 | AUDIOGEN_CHECK(options.SetHardwareAccelerators(litert::HwAccelerators::kCpu)); |
| 163 | auto& cpu_options = get_litert_value(options.GetCpuOptions()); |
| 164 | AUDIOGEN_CHECK(cpu_options.SetNumThreads(static_cast<int>(num_threads))); |
| 165 | AUDIOGEN_CHECK(cpu_options.SetXNNPackFlags(xnnpack_flags)); |
| 166 | return options; |
| 167 | } |
| 168 | |
| 169 | static void read_wav(const std::string& path, std::vector<float>& left_ch, std::vector<float>& right_ch) { |
| 170 | // You can use this command to convert the file to the expected format: |
no test coverage detected