wechatDataBackup/pkg/lame
2024-08-26 22:56:29 +08:00
..
clame init 2024-08-26 22:56:29 +08:00
.gitignore init 2024-08-26 22:56:29 +08:00
lame.go init 2024-08-26 22:56:29 +08:00
LICENSE init 2024-08-26 22:56:29 +08:00
README.md init 2024-08-26 22:56:29 +08:00
writer.go init 2024-08-26 22:56:29 +08:00
z_link_lame_c.c init 2024-08-26 22:56:29 +08:00

lame

Simple libmp3lame powered mp3 encoder for Go

Note: this project is obsolete, consider moving to https://github.com/viert/go-lame

Example:

package main

import (
  "bufio"
  "lame"
  "os"
)

func main() {
  f, err := os.Open("input.raw")
  if err != nil {
    panic(err)
  }
  defer f.Close()
  reader := bufio.NewReader(f)

  of, err := os.Create("output.mp3")
  if err != nil {
    panic(err)
  }
  defer of.Close()

  wr := lame.NewWriter(of)
  wr.Encoder.SetBitrate(112)
  wr.Encoder.SetQuality(1)

  // IMPORTANT!
  wr.Encoder.InitParams()

  reader.WriteTo(wr)

}