-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
I'm working on a program that is using SharedMemory to send data between processes and it would be really nice if I could have samplerate just write directly to the buffer, so I don't have to copy it from the return result.
Thinking all that would be needed is to add an optional out parameter that, if present, is used instead of the below code.
python-samplerate/src/samplerate.cpp
Lines 164 to 168 in d737def
| // allocate output array | |
| std::vector<size_t> out_shape{new_size}; | |
| if (inbuf.ndim == 2) out_shape.push_back(static_cast<size_t>(channels)); | |
| auto output = py::array_t<float, py::array::c_style>(out_shape); | |
| py::buffer_info outbuf = output.request(); |
Looks like libsamplerate already supports setting the out pointer:
typedef struct
{ float *data_in, *data_out ;
long input_frames, output_frames ;
long input_frames_used, output_frames_gen ;
int end_of_input ;
double src_ratio ;
} SRC_DATA ;
Metadata
Metadata
Assignees
Labels
No labels