Code Monkey home page Code Monkey logo

go-wave's People

Contributors

joernweissenborn avatar mayamatakeshi avatar mitakeck avatar zenwerk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

go-wave's Issues

16bit writer should use []int16, not []uint16

If you write uint16 data, when the wave data is played back, the audio is noisy and sounds distorted.

I think it is better to ask for a slice of []int16 to avoid this issue.

A work-around is to pack int16 data into the uint16 format before calling WriteSample16, like so:

uInt16Slice := *(*[]uint16)(unsafe.Pointer(&int16Slice)) _, err := waveWriter.WriteSample16(uInt16Slice)

Note: shifting the int16 samples into the range of int16 did not fix the problem. At first, I thought that I would just need to add -1 << 15 to each int sample to get the uint equivalent, but it is distorted as well.

func (w *Writer) WriteSample16(samples []uint16) (int, error) {

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.