Coder Social home page Coder Social logo

intercom's Introduction

Intercom

Golang GRPC stream server and client for sending audio and video.

This is a demonstration of a bi-directional GRPC stream, while also being somewhat interesting in that it is streaming audio and images with the connected microphone and webcam. I have so far only tested on a Macbook Pro. While the following installation instructions are for OSX as well, there is no reason this wouldn't work on other OS's with the proper gocv and portaudio installations.

I would eventually like to target running on a Raspberry Pi with an attached display, webcam, and microphone. Otherwise, I hope to learn a bit about:

  • GRPC Streams
  • Golang Threading
  • Audio/Video

Dev Workstation Setup

  1. Install Opencv

    brew install opencv
    

    Install pk-config if not already installed

    brew install pkg-config
    

    be sure to have pkg-config var set correctly

    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
    

    Opencv comes with it's own .pc, move it or simlink it to the PKG_CONFIG_PATH

    ln -s /usr/local/opt/opencv@4/lib/pkgconfig/opencv4.pc $PKG_CONFIG_PATH
    

    Add these lines to your environment .bash_profile or similiar

    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
    alias opencvflags="pkg-config --cflags --libs opencv"
    
  2. Install PortAudio

    brew install portaudio
    

GRPC

Using protobuf and protoc for code-generation of go files (i.e. intercom.pb.go)

To generate updated proto files, run:

cd _proto
protoc \
  -I ./ \
  --go_out=plugins=grpc:../proto \
  intercom.proto

Running

  1. Start Server

    cd cmd/server
    go run main.go
    
  2. Start Client

    cd cmd/client
    go run main.go 0 [path to background image, hopefully a kitten]
    

    Press [Spacebar] to broadcast

    Press [Esc] to exit

    Note that feedback can occur. Once multiple clients are supported this can be addressed.

intercom's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

lwgboy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.