mirror of
https://github.com/nonoo/kappanhang.git
synced 2026-01-16 22:00:06 +01:00
Fix sending audio
This commit is contained in:
parent
0fc6ec04b0
commit
00aeab93b5
|
|
@ -104,7 +104,9 @@ func (a *audioStruct) recLoop(deinitNeededChan, deinitFinishedChan chan bool) {
|
|||
buf.Write(frameBuf[:n])
|
||||
|
||||
for buf.Len() >= len(frameBuf) {
|
||||
n, err = buf.Read(frameBuf)
|
||||
// We need to create a new []byte slice for each chunk to be able to send it through the rec chan.
|
||||
b := make([]byte, len(frameBuf))
|
||||
n, err = buf.Read(b)
|
||||
if err != nil {
|
||||
reportError(err)
|
||||
}
|
||||
|
|
@ -113,7 +115,7 @@ func (a *audioStruct) recLoop(deinitNeededChan, deinitFinishedChan chan bool) {
|
|||
}
|
||||
|
||||
select {
|
||||
case a.rec <- frameBuf:
|
||||
case a.rec <- b:
|
||||
case <-deinitNeededChan:
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue