Coder Social home page Coder Social logo

darkaxi0m / play_stdin.sh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from connor-brooks/play_stdin.sh

0.0 1.0 0.0 13 KB

A set of lightweight scripts to stream audio between two Linux machines. Perfect for use with a Raspberry Pi

Home Page: http://connor-brooks.com/play_stdin.sh.html

Shell 100.00%

play_stdin.sh's Introduction

play_stdin.sh

Stream audio via UNIX pipes

This simple set of scripts allows streaming audio between two Linux machines, for example, a laptop and a Raspberry Pi. No audio backends such as Pulseaudio or JACK are required, the list of dependencies is very small.

Requirements (server)

  • ncat (from nmap)
  • ffplay

Requirements (client)

  • netcat (any)

Instructions

Server

Get the script

SSH into your server, and download the scripts via git:

git clone https://github.com/connor-brooks/play_stdin.sh.git

Install dependancies

If you're using a Raspberry Pi:

sudo apt-get install ffplay nmap

Configure (optional)

With the text editor of you choice, edit line 2 of play_stdin_server.sh and change the CONTROLLER_PORT variable to whatever port you want, for example run:

nano play_stdin_server.sh

Change the port number, and save.

Run the server

To start the server, run the following command: ./play_stdin_server.sh &

You can now disconnect from the Raspberry Pi, but before you do, make sure to take note of your servers IP address, buy running the following:

sudo ifconfig

Generally your ip address will be in the format of 192.168.xxx.xxx

Client

Get the script

git clone https://github.com/connor-brooks/play_stdin.sh.git

Configure:

Using the text editor of your choice, edit line 2 and 3 of play_stdin.sh to match the port and IP of your server.

Play some music

cat music.mp3 | ./play_stdin.sh &

Where music.mp3 is the song you'd like to play.

Play and pause

To pause from your client:

./play_stdin.sh TOGGLE

Or to stop the stream:

./play_stdin.sh STOP

Notes

  • You can easily bind the toggle and stop commands using xbindkeys for a more seamless experience
  • It is possible to stream any audio format supported by FFmpeg
  • If you are using netcat-traditional or netcat-openbsd on your server you may run into some issues, it is recommended to use ncat from the nmap package

play_stdin.sh's People

Contributors

connor-brooks avatar

Watchers

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