Skip to content

Static jitter buffer#34

Open
fouf wants to merge 2 commits into
layeh:masterfrom
fouf:jitterbuffer
Open

Static jitter buffer#34
fouf wants to merge 2 commits into
layeh:masterfrom
fouf:jitterbuffer

Conversation

@fouf

@fouf fouf commented Feb 15, 2017

Copy link
Copy Markdown

No description provided.

@dchote

dchote commented Nov 16, 2017

Copy link
Copy Markdown

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

fouf commented Nov 16, 2017

Copy link
Copy Markdown
Author

@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

dchote commented Nov 17, 2017

Copy link
Copy Markdown

Awesome, thanks!

@dchote

dchote commented Nov 17, 2017

Copy link
Copy Markdown

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
Copy Markdown

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

@porjo porjo left a comment

Copy link
Copy Markdown

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

Comment thread gumble/handlers.go
event := AudioPacket{
Client: c,
Sender: user,
if err := user.buffer.AddPacket(&jbAudioPacket{

Copy link
Copy Markdown

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...

Comment thread gumble/jitterbuffer.go
User: j.user,
C: ch,
}
item.listener.OnAudioStream(&event)

Copy link
Copy Markdown

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