feat(realtime): Initial Realtime API implementation

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-10-02 11:16:11 +02:00 committed by Richard Palethorpe
parent 456b4982ef
commit ae6069a0a0
13 changed files with 1453 additions and 1135 deletions

12
pkg/sound/float32.go Normal file
View file

@ -0,0 +1,12 @@
package sound
import (
"encoding/binary"
"math"
)
func BytesFloat32(bytes []byte) float32 {
bits := binary.LittleEndian.Uint32(bytes)
float := math.Float32frombits(bits)
return float
}