音频流仍然存在问题,后续debug
This commit is contained in:
@@ -24,7 +24,7 @@ func New(o *Options) (*Connection, error) {
|
||||
connection := &Connection{
|
||||
option: o,
|
||||
}
|
||||
codecSelector, err := setupCodec(o.Video.BPS, o.Audio.BPS)
|
||||
codecSelector, err := setupCodec(o.Video.BPS)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -123,7 +123,7 @@ func (c *Connection) Regist(offer *webrtc.SessionDescription) (*webrtc.SessionDe
|
||||
return rtc.LocalDescription(), nil
|
||||
}
|
||||
|
||||
func setupCodec(videoBPS, audioBPS int) (*mediadevices.CodecSelector, error) {
|
||||
func setupCodec(videoBPS int) (*mediadevices.CodecSelector, error) {
|
||||
x264Prarm, err := x264.NewParams()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -134,7 +134,6 @@ func setupCodec(videoBPS, audioBPS int) (*mediadevices.CodecSelector, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
opusParam.BitRate = audioBPS
|
||||
|
||||
codecSelector := mediadevices.NewCodecSelector(
|
||||
mediadevices.WithAudioEncoders(&opusParam),
|
||||
|
@@ -7,9 +7,6 @@ type Options struct {
|
||||
Width int `yaml:"width"`
|
||||
BPS int `yaml:"bps"`
|
||||
} `yaml:"video"`
|
||||
Audio struct {
|
||||
BPS int `yaml:"bps"`
|
||||
} `yaml:"audio"`
|
||||
}
|
||||
|
||||
func ExampleOptions() *Options {
|
||||
@@ -22,6 +19,5 @@ func ExampleOptions() *Options {
|
||||
options.Video.BPS = 500_000
|
||||
options.Video.Height = 768
|
||||
options.Video.Width = 1024
|
||||
options.Audio.BPS = 96_000
|
||||
return options
|
||||
}
|
||||
|
Reference in New Issue
Block a user