add opus audio initial support

This commit is contained in:
Leandro Moreira
2024-05-19 00:36:36 -03:00
parent 5960c45e1f
commit ea736898d9
11 changed files with 246 additions and 126 deletions

View File

@@ -123,12 +123,8 @@ func (d *donutEngine) RecipeFor(server, client *entities.StreamInfo) (*entities.
Codec: entities.Opus,
// TODO: create method list options per Codec
CodecContextOptions: []entities.LibAVOptionsCodecContext{
// opus specifically works under 48000 Hz
entities.SetSampleRate(48000),
// once we changed the sample rate we need to update the time base
entities.SetTimeBase(1, 48000),
// for some reason it's setting "s16"
// entities.SetSampleFormat("fltp"),
entities.SetSampleFormat("fltp"),
},
},
}