Beep是一个处理和访问音频的库。
特性
- Decode and play WAV, MP3, OGG, and FLAC.
- Encode and save WAV.
- Very simple API. Limiting the support to stereo (two channel) audio made it possible to simplify the architecture and the API.
- Rich library of compositors and effects. Loop, pause/resume, change volume, mix, sequence, change playback speed, and more.
-
Easily create new effects. With the
Streamer
interface, creating new effects is very easy. -
Generate completely own artificial sounds. Again, the
Streamer
interface enables easy sound generation. - Very small codebase. The core is just ~1K LOC.
代码样例
package main
import (
"log"
"os"
"github.com/faiface/beep"
)
func main() {
f, err := os.Open("Rockafeller Skank.mp3")
if err != nil {
log.Fatal(err)
}
}
源码地址:https://github.com/faiface/beep
有疑问加站长微信联系(非本文作者)