Added some funcs.
This commit is contained in:
parent
c59702fcff
commit
883053a85c
@ -7,8 +7,8 @@ import (
|
||||
"github.com/gen2brain/aac-go"
|
||||
)
|
||||
|
||||
// ConvertG711ToAAC converts G711 to AAC.
|
||||
func ConvertG711ToAAC(g711Samples []byte, mulaw bool) ([]byte, error) {
|
||||
// ConvertG711ToLPCM converts G711 to LPCM.
|
||||
func ConvertG711ToLPCM(g711Samples []byte, mulaw bool) []byte {
|
||||
var pcmSamples []byte
|
||||
if mulaw {
|
||||
pcmSamples = g711.DecodeMulaw(g711Samples)
|
||||
@ -16,6 +16,11 @@ func ConvertG711ToAAC(g711Samples []byte, mulaw bool) ([]byte, error) {
|
||||
pcmSamples = g711.DecodeAlaw(g711Samples)
|
||||
}
|
||||
|
||||
return pcmSamples
|
||||
}
|
||||
|
||||
// ConvertLPCMToAAC converts G711 to AAC.
|
||||
func ConvertLPCMToAAC(pcmSamples []byte) ([]byte, error) {
|
||||
var buf bytes.Buffer
|
||||
opts := &aac.Options{
|
||||
SampleRate: 8000, // Исходная частота G711
|
||||
|
Loading…
x
Reference in New Issue
Block a user