Skip to content

ProvideOpusFrame Panics, doesn't provide error #318

Closed Answered by topi314
tmaffia asked this question in Help
Discussion options

You must be logged in to vote

conn.UDP().Write() expects you to write exactly one Opus frame.

This means you need to split the frames from an opus frame yourself

The example uses the voice.NewOpusReader which implements the OpusFrameProvider interface

You need to call conn.SetOpusFrameProvider() with the voice.NewOpusReader() to make it play the whole opus file

voice.NewOpusReader() expects the following format of the opus file:
Frame length (4 bytes) Opus Frame (x Bytes)
And repeat
You can check the implementation here https://github.com/disgoorg/disgo/blob/master/voice/opus.go#L20

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by topi314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
2 participants
Converted from issue

This discussion was converted from issue #317 on September 25, 2023 08:07.