Skip to content

Commit

Permalink
fix stereo audio dump (f-contig)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yikai-Liao committed Jan 14, 2025
1 parent 434f3dd commit 3970197
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions py_src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ nb::module_& bind_synthesizer(nb::module_& m) {
m.def(
"dump_wav",
[](const std::string& path,
const nb::ndarray<f32, nb::shape<-1, -1>, nb::device::cpu, nb::c_contig>& data,
const nb::ndarray<f32, nb::shape<-1, -1>, nb::device::cpu, nb::f_contig>& data,
const i32 sample_rate,
const bool use_int16) {
psynth::WAVE_write(
Expand All @@ -73,23 +73,6 @@ nb::module_& bind_synthesizer(nb::module_& m) {
nb::arg("sample_rate"),
nb::arg("use_int16") = true
);

m.def(
"dump_wav",
[](const std::filesystem::path& path,
const nb::ndarray<f32, nb::shape<-1, -1>, nb::device::cpu, nb::c_contig>& data,
const i32 sample_rate,
const bool use_int16) {
const std::string path_str = path.string();
psynth::WAVE_write(
path_str, data.shape(0), data.shape(1), sample_rate, data.data(), use_int16
);
},
nb::arg("path"),
nb::arg("data"),
nb::arg("sample_rate"),
nb::arg("use_int16") = true
);
return m;
}

Expand Down

0 comments on commit 3970197

Please sign in to comment.