Golang Beep:将播放的声音流式传输或保存到文件或 http 端点

问题描述 投票:0回答:1

我正在使用这个模块在我的项目中播放声音 - https://github.com/faiface/beep 我想播放声音以及将声音播放到文件或 http 端点的流。

I am adding streams to mixer like this:
soundMixer.Add(stream)

speaker.Play(s.soundMixer)

有人可以帮我吗? 任何帮助表示赞赏

go audio beep
1个回答
0
投票

您的程序在声音播放之前就已完成。

    done := make(chan bool)
    speaker.Play(beep.Seq(streamer, beep.Callback(func() {
        done <- true
    })))
    <-done
© www.soinside.com 2019 - 2024. All rights reserved.