加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
opus.go 911 Bytes
一键复制 编辑 原始数据 按行查看 历史
// Copyright © 2015-2017 Go Opus Authors (see AUTHORS file)
//
// License for use of this code is detailed in the LICENSE file
package opus
/*
// Link opus using pkg-config.
#cgo pkg-config: opus
#include <opus.h>
*/
import "C"
type Application int
const (
// Optimize encoding for VoIP
AppVoIP = Application(C.OPUS_APPLICATION_VOIP)
// Optimize encoding for non-voice signals like music
AppAudio = Application(C.OPUS_APPLICATION_AUDIO)
// Optimize encoding for low latency applications
AppRestrictedLowdelay = Application(C.OPUS_APPLICATION_RESTRICTED_LOWDELAY)
)
const (
xMAX_BITRATE = 48000
xMAX_FRAME_SIZE_MS = 60
xMAX_FRAME_SIZE = xMAX_BITRATE * xMAX_FRAME_SIZE_MS / 1000
// Maximum size of an encoded frame. I actually have no idea, but this
// looks like it's big enough.
maxEncodedFrameSize = 10000
)
func Version() string {
return C.GoString(C.opus_get_version_string())
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化