Skip to content

A small clamping inaccuracy in the oto Speaker writer #88

@ajzaff

Description

@ajzaff

valInt16 := int16(val * (1<<15 - 1))

Currently this returns the wrong values for an input of -1.

I believe this should fix it:

valInt16 = int16((-1<<15)+(val+1)/2*(1<<16-1))

https://play.golang.org/p/E-8wkFoIHQ3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions