Giter Site home page Giter Site logo

schollz / streammyaudio Goto Github PK

View Code? Open in Web Editor NEW
74.0 5.0 9.0 873 KB

Easily stream audio from any computer to the internet.

Home Page: https://streammyaudio.com

License: GNU General Public License v3.0

Go 46.91% HTML 51.08% Makefile 2.01%
audio audio-streaming streaming streaming-audio

streammyaudio's Introduction

stream your audio

This program/server lets you livestream audio from your computer to a website as easily as possible. How easy? You should be able to just download a release, double-click it, and stream!

Use it to play demos for people you know, or make a live podcast, or stream your piano practice, or whatever you'd like.

live website: https://streammyaudio.com

blog (more info): https://schollz.com/blog/stream

Usage

The easiest way to use this is to download the latest release. But you can build it yourself. This codebase includes both the server and the client.

Linux

The basic build (Linux only) is:

git clone https://github.com/schollz/streammyaudio
cd streammyaudio
go build -v

which will build both the server and client, though you will also need ffmpeg installed.

You actually don't need to build this if just want to stream audio on Linux. You can directly just use ffmpeg and curl to send live audio:

ffmpeg -f alsa -i hw:0 -f mp3 - | \
    curl -s -k -H "Transfer-Encoding: chunked" -X POST -T - \
    "https://streammyaudio.com/YOURSTATIONNAME.mp3?stream=true&advertise=true"

Or similar. See the website for more ideas.

Windows

Windows basically is the same but it will automatically bundle a statically-compiled ffmpeg to self-contain the client. You can simply run

make build-windows

to build the client with ffmpeg so that it is a portale app.

Mac OS

Mac OS basically is the same but it will automatically bundle a statically-compiled ffmpeg to self-contain the client. You can simply run

make build-mac

for most macs, or

make build-mac-arm

for M1 macs. These will automatically bundle with the right version of ffmpeg.

License

GPL

streammyaudio's People

Contributors

gregsadetsky avatar schollz avatar strickinato avatar supersonichub1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

streammyaudio's Issues

windows client quits immediately after starting stream

using the windows client quits immediately after trying to start a stream:

Untitled.mp4

Might be related that the only input device option is obs virtual camera (video (sic) - this was the only option even when I wasn't running obs at all to record this video. I'm not sure what options are supposed to be there, but I was expecting something like "computer sound card".

Autoplay my stream

Can you make the stream autoplay in browser once the listener opens the link the stream automatically play or the mp3 url autoplay?
Thanks for the great website and the great tool

Self hosted option

First off, thank you for your work on this. I think it's really cool.

How easy/difficult would it be to self-host the server so that private audio could be hosted over LAN and VPN?

Made a neat audio station script!

Made a neat little script with yt-dlp in order to stream the entirety of what the program considers a "playlist" (YouTube playlist, Bandcamp album, etc.)

#!/bin/bash

yt-dlp-to-ffconcat() {
	local url=$1
	yt-dlp --format bestaudio --get-url "$url" | sed -e "s/^/file '/" | sed -e "s/$/'/"
}

main() {
	local url=$1
	local station=$2
	ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto \
		-f concat -safe 0 -i <(yt-dlp-to-ffconcat "$url") \
		-f mp3 -ar 44100 -b:a 256k - | \
		cstream -t 64k | \
    	curl -s -k -H "Transfer-Encoding: chunked" -X POST -T -  \
    	"https://streammyaudio.com/$station.mp3?stream=true&advertise=true"
}

main "$@"

You can then make this script executable and use it like this:

./stream-playlist.bash "https://www.youtube.com/playlist?list=PL2D4C428C2C10BCFF" vgm

This is pretty awesome as it allows you to stream a lot of content and not have to download it to your PC! You can throw shuf into the mix as well with a big playlist and have music to listen to with your buds for hours!

If I feel like it, I might convert this into a Python script and use aiohttp to send a message about the currently playing song into chat. Perhaps I could even take requests via commands as well.

If you're awake when I create this issue, you can listen to the Street Fighter 3 soundtrack on the vgm station. This feels especially appropriate seeing as you made a blog post about drum and bass the other day.

Thank you!

Not an issue. In fact, quite the opposite. I'd love to thank you from the bottom of my heart. With your project, I'm not able to RP a DJ set in the GTA RP city I play in and actually DJ the set. I've been looking for a way to do this for a while and have been coming up empty handed. Until now that is. I wish I had some money to throw at you for domain/hosting costs, but all I can throw at you is maybe more people to use your software the same way I am that may be able to help more. Again, Thank You!

Server Questions

Hello✌️
I would first like to say thank you so much for making Stream My Audio! I have been testing it to broadcast a live synthesizer performance and I love it. The only issue is sometimes the program will close on its own (like a disconnect). And also sometimes it seems like the server is down and my stream doesn’t work. Any reason this might be happening? I would love to contribute (even more per month than whats listed) but I would like to invest in Stream My Audio only. Is there anyway I can add monthly funds to Stream My Audio? The main issue I am having is reliability. Great job though … awesome product/service ♥️

Doesn't launch

Hi,
Thank you for this. The command line works great but the Linux release doesn't launch on my Manjaro Xfce...

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.