Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static jitter buffer #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Static jitter buffer #34

wants to merge 2 commits into from

Conversation

fouf
Copy link

@fouf fouf commented Feb 15, 2017

No description provided.

@dchote
Copy link

dchote commented Nov 16, 2017

Hey Fouf, I just tried to merge this in to my fork and ran in to a missing function in the published gopus.

gopus.GetSamplesPerFrame(data, gumble.AudioSampleRate)

GetSamplesPerFrame does not exist in layeh.com/gopus, im wondering if you have local edits that you could share.

many thanks

@fouf
Copy link
Author

fouf commented Nov 16, 2017

@dchote I still have this code kicking around, I can't vouch for it working or anything, so good luck!

func GetSamplesPerFrame(data []byte, samplingRate int) (int, error) { 
        dataPtr := (*C.uchar)(unsafe.Pointer(&data[0]))
        cSamplingRate := C.opus_int32(samplingRate)
        cRet := C.opus_packet_get_samples_per_frame(dataPtr, cSamplingRate)
        /*if err := getErr(cRet); err != nil {
                return 0, err
        }*/
        return int(cRet), nil
}

This resides inside opus_nonshared.go inside the gopus directory.

@dchote
Copy link

dchote commented Nov 17, 2017

Awesome, thanks!

@dchote
Copy link

dchote commented Nov 17, 2017

I got this merged in to https://github.com/dchote/talkiepi & https://github.com/dchote/gumble

Seems to be working as anticipated! Will do some heavier multi user testing tomorrow!

@ghost ghost mentioned this pull request Aug 10, 2018
@athasamid
Copy link

@dchote why I still getting choppy sound? how to solve this problem?

Copy link

@porjo porjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fouf thanks for your contribution. There are a couple of issues I can see - I've left some comments

event := AudioPacket{
Client: c,
Sender: user,
if err := user.buffer.AddPacket(&jbAudioPacket{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is user.buffer being initialised? I'm getting nil pointer dereference error here...

User: j.user,
C: ch,
}
item.listener.OnAudioStream(&event)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit is broken. Creating the AudioPacket channel and calling OnAudioStream() should only happen once. The client has a goroutine running listening on the channel, so it doesn't make sense to be closing it every time the heap size goes to zero (which happens when nobody is speaking).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants