MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / write_f32_file

Function write_f32_file

tests/audio/stft_parity_dump.cpp:15–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13namespace {
14
15void write_f32_file(const std::filesystem::path & path, const std::vector<float> & values) {
16 std::ofstream out(path, std::ios::binary);
17 if (!out) {
18 throw std::runtime_error("failed to open output file: " + path.string());
19 }
20 out.write(reinterpret_cast<const char *>(values.data()), static_cast<std::streamsize>(values.size() * sizeof(float)));
21 if (!out) {
22 throw std::runtime_error("failed to write output file: " + path.string());
23 }
24}
25
26void write_i64_file(const std::filesystem::path & path, const std::vector<int64_t> & values) {
27 std::ofstream out(path, std::ios::binary);

Callers 1

mainFunction · 0.70

Calls 3

writeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected