美文网首页GO
核心代码只有约1K行Golang代码的音频处理库:Beep

核心代码只有约1K行Golang代码的音频处理库:Beep

作者: 翟志军 | 来源:发表于2021-01-26 07:54 被阅读0次
    image.png

    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

    相关文章

      网友评论

        本文标题:核心代码只有约1K行Golang代码的音频处理库:Beep

        本文链接:https://www.haomeiwen.com/subject/bejjzktx.html