-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
The problem is in pkg/driver/microphone/microphone.go lines 133...
onRecvChunk := func(_, chunk []byte, framecount uint32) {
select {
case <-cancelCtx.Done():
case m.chunkChan <- chunk:
}
}
Callback function of malgo audio capture. The chunk buffer is send to channel.
Malgo will reuse the buffer while it is beeing processed.
You have to make a copy of chunk before sending it to the channel.
onRecvChunk := func(_, chunk []byte, framecount uint32) {
newChunk := make([]byte, len(chunk))
copy(newChunk, chunk)
select {
case <-cancelCtx.Done():
case m.chunkChan <- newChunk:
}
}
Please fix.
Regards,
dezi
Metadata
Metadata
Assignees
Labels
No labels