Git Product home page Git Product logo

radcs's Introduction

gRPC

https://grpc.io/

https://grpc.io/docs/what-is-grpc/introduction/

gRPCalsa

This project demonstrates how to access ALSA backend via grpc. It uses streaming capabilities of grpc and ALSA to play / record audio. The server implements the grpc interface and has access to ALSA. The client is using the grpc interface for sending pcm samples to server and receiving pcm samples. First client plays a sine tone of 5 seconds and then records from microphone 5 seconds of data.

Architecture

interface

#grpcalsa.proto
service GrpcAlsa {
  rpc PlayStream(stream AudioData) returns (PlayStatus){}
  rpc RecordStream(RecordRequest) returns (stream AudioData){}
  rpc GetStreamParameter(StreamType) returns (StreamParameter){}
}

Please see protos folder for complete definition.

build environment

Tested with ubuntu 20.04, gcc 7.4.0. Please install all required prerequisites for grpc, see grpc documentation. This project pulls grpc from github and builds it from source. Check cmake files for details.

Test

Start the server in new console window

./server

Start the client in a new console window

./client

Observe the sine tone payed on pc speakers. After sine tone is played a stream is recorded from pc microphone. The recorded stream can be played by issuing

aplay -r 24000 recorded_stream.wav 

radcs's People

Contributors

ahubi avatar

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.