音频采样率解析bug修复

This commit is contained in:
langhuihui
2020-03-08 16:35:25 +08:00
parent c8538d3c9c
commit a08538e66e
3 changed files with 3 additions and 3 deletions

View File

@@ -189,7 +189,7 @@ type ADTSFixedHeader struct {
// 2: Scalable Sampling Rate profile(SSR)
// 3: Reserved
//
var SamplingFrequencies = [...]int{96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350}
var SamplingFrequencies = [...]int{96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350, 0, 0, 0}
// Sampling Frequencies[]:
//

View File

@@ -16,7 +16,7 @@ var (
// ConfigRaw 配置信息的原始数据
ConfigRaw []byte
// Version 引擎版本号
Version = "1.1.0"
Version = "1.1.1"
// EngineInfo 引擎信息
EngineInfo = &struct {
Version string

View File

@@ -197,7 +197,7 @@ func (r *Room) PushAudio(audio *avformat.AVPacket) {
// 2 AAC LC ISO/IEC 14496-3 subpart 4
// 3 AAC SSR ISO/IEC 14496-3 subpart 4
// 4 AAC LTP ISO/IEC 14496-3 subpart 4
r.AudioInfo.SoundRate = avformat.SamplingFrequencies[((config1&0x7)<<1)|(0x90>>7)]
r.AudioInfo.SoundRate = avformat.SamplingFrequencies[((config1&0x7)<<1)|(config2>>7)]
r.AudioInfo.SoundType = (config2 >> 3) & 0x0F //声道
//frameLengthFlag = (config2 >> 2) & 0x01
//dependsOnCoreCoder = (config2 >> 1) & 0x01