mirror of
https://github.com/mudler/LocalAI.git
synced 2025-01-14 00:40:09 +00:00
6e60879bfe
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
13 lines
192 B
Go
13 lines
192 B
Go
package sound
|
|
|
|
import (
|
|
"encoding/binary"
|
|
"math"
|
|
)
|
|
|
|
func BytesFloat32(bytes []byte) float32 {
|
|
bits := binary.LittleEndian.Uint32(bytes)
|
|
float := math.Float32frombits(bits)
|
|
return float
|
|
}
|