roc-go icon indicating copy to clipboard operation
roc-go copied to clipboard

Add standalone examples

Open gavv opened this issue 5 years ago • 0 comments

We have "Quick start" section in README which shows how to use sender and receiver.

In addition, we also should add a few complete stand-alone examples, which can be compiled to executables and run from command-line.

We can start with implementing two examples:

  • Sender. A tool that generates a sine wave and sends it to remote Roc receiver.
  • Receiver. A tool that receives sound from remote sender and plays it to speakers using some sound library.

We already have a similar example for the C API: https://roc-streaming.org/toolkit/docs/api/examples.html

The C API is documented here: https://roc-streaming.org/toolkit/docs/api/reference.html The Go bindings to it are documented here: https://pkg.go.dev/github.com/roc-streaming/roc-go/roc

The file e2e_test.go and "Quick start" section in README provide almost all the code needed for these examples, except generating sine wave and playing sound. For playing sound, we should use some cross-platform go library with simple API that would not complicate example too much.

The code of examples should be well commented and explain each step. Comments can be mostly adopted from the C examples linked above. We should also add a section to README describing what examples we have and how to run them.

gavv avatar Jun 08 '20 07:06 gavv