Skip to content
Encode and decode wave audio files.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.md
README.md
io.go
reader.go
reader_test.go
wave.go
writer.go
writer_test.go

README.md

wave

GoDoc Go Report Card

Encode and decode wave files.

func main() {
  r, err := os.Open("busted-and-blue.wav")
  if err != nil {
    log.Fatal(err)
  }
  defer r.Close()
  br := bufio.NewReader(r)

  wavr, err := wave.NewReader(br)
  if err != nil {
    log.Fatal(err)
  }

  for {
    sample, err := wavr.ReadSample()
    if err != nil {
      if err == io.EOF {
        break
      }
      log.Fatal(err)
    }
    fmt.Println(sample)
  }
}
You can’t perform that action at this time.