Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

217 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

meowcaller

Go Reference

meowcaller is a Go library for the WhatsApp Web VoIP stack. It is 100% pure GO without CGO and it has minimal dependencies. It includes the novel proprietary audio codec MLOW written and validated completely in GO. In turn, meowcaller does not rely on any native bindings and can run everywhere that GO can.

Discussion

Matrix room: #meowcaller:matrix.org.

Discord channel: #meowcaller in the WhiskeySockets Discord server.

You can find the underlying spec in the WhatsApp Calls Research Group. Video transition behavior is cross-checked against the independently implemented whatsapp-rust call stack.

Usage

The godoc includes docs for all methods.

There's a range of examples in the examples directory.

The API is easy to approach and implement: attach a Source to send media, a Sink to receive it, and register callbacks for call events.

A 12-line example to show the power and simplicity of the library:

// wa is a whatsmeow.Client
client := meowcaller.NewClient(wa)

client.OnIncomingCall(func(call *meowcaller.Call) {
    call.Answer()

    if mp3, err := meowcaller.MP3File("hello.mp3"); err == nil {
        call.Play(mp3)               // stream audio to the caller
    }
    if wav, err := meowcaller.WAVRecorder("caller.wav"); err == nil {
        call.Receive(wav)            // record their voice
    }
    if h264, err := meowcaller.AnnexBRecorder("caller.h264"); err == nil {
        call.ReceiveVideo(h264)      // record their video
    }
})

// Placing a call is just as short:
call, _ := client.Call(ctx, "+15551234567")
call.Receive(meowcaller.SinkFunc(func(pcm []float32) { /* the peer's audio */ }))

Features

Core VoIP features are present:

  • Outbound calls
  • Inbound calls
  • Audio calls (the pure-Go MLow codec)
  • Video calls, including calls that start with video
  • Mid-call audio-to-video upgrade, acceptance, rejection, cancellation, and downgrade
  • Camera orientation and authenticated video keyframe feedback
  • Send and receive call emoji reactions over the dedicated RTC app-data stream
  • Experimental ad-hoc and group-bound group calls, including add/ring participant
  • Experimental reusable call links and approval waiting rooms
  • Experimental participant video/reactions, arbitrary emoji, hand state, and screen-share state

The experimental group surface uses the latest upstream go.mau.fi/whatsmeow; it does not require a fork. See the group-call feature guide and the examples/web browser test console.

Things that are not yet implemented:

  • Opus codec fallback for clients not using MLOW (in progress; testing edge cases)
  • Scheduled-call event messages (the call link itself is supported)

Credits

meowcaller relies heavily on primitives that are implemented in the WhatsApp Calls Research Group. I thank all the developers who have contributed to it.

The video transition lifecycle was validated against whatsapp-rust PR #1024, an independent implementation of the same protocol.

Sponsoring and contribution

You may contribute to the maintenance of this library by sponsoring its maintainers on GitHub.

You may also submit pull requests and issues where relevant, given you follow the contributor Code of Conduct.

License

This repository follows the MIT license, as stated in the LICENSE file

About

WhatsApp VoIP Go library for whatsmeow

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

Contributors

Languages