Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/bitdepth/bitdepth.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var (

// Float32ToSigned16 quantizes a float32 PCM sample to signed 16-bit PCM.
func Float32ToSigned16(sample float32) int16 {
sample64 := math.Round(float64(sample * 32768))
sample64 := math.Floor(0.5 + float64(sample*32768))
sample64 = math.Max(sample64, -32768)
sample64 = math.Min(sample64, 32767)

Expand Down
Loading
Loading