debug
This commit is contained in:
parent
00bd8c4c64
commit
a9d531c6fc
|
@ -40,14 +40,21 @@ int sendCustomAudioData(int16_t destChannelIndex, py::array_t<int16_t> inputArra
|
||||||
int32_t sampleRate, uint64_t channelNum, uint64_t dataLen) {
|
int32_t sampleRate, uint64_t channelNum, uint64_t dataLen) {
|
||||||
py::gil_scoped_release release;
|
py::gil_scoped_release release;
|
||||||
|
|
||||||
auto buf = inputArray.request();
|
py::array_t<int16_t> contiguous = py::array::ensure(inputArray);
|
||||||
|
if (!contiguous) throw py::value_error("Array conversion failed");
|
||||||
|
auto buf = contiguous.request();
|
||||||
if (buf.size != dataLen) {
|
if (buf.size != dataLen) {
|
||||||
throw py::value_error("Array length does not match dataLen");
|
throw py::value_error("Array length does not match dataLen");
|
||||||
}
|
}
|
||||||
|
std::vector<int16_t> localCopy(static_cast<int16_t*>(buf.ptr),
|
||||||
|
static_cast<int16_t*>(buf.ptr) + buf.size);
|
||||||
|
|
||||||
return RTCContext::instance().sendCustomAudioData(
|
return RTCContext::instance().sendCustomAudioData(
|
||||||
destChannelIndex, buf.ptr, sampleRate, channelNum, dataLen
|
destChannelIndex, localCopy.data(), sampleRate, channelNum, dataLen
|
||||||
);
|
);
|
||||||
|
//return RTCContext::instance().sendCustomAudioData(
|
||||||
|
// destChannelIndex, buf.ptr, sampleRate, channelNum, dataLen
|
||||||
|
//);
|
||||||
}
|
}
|
||||||
py::list getListData() {
|
py::list getListData() {
|
||||||
return RTCContext::instance().getListData();
|
return RTCContext::instance().getListData();
|
||||||
|
|
Loading…
Reference in New Issue