Archivio dei tag webradio

Audio virtual device for MAC

If you play with streaming, podcast, mixing, webradio or you want to setup an audio recording studio at home you may find difficult to get audio from some sources and record or use in your live set. 

While in a real analog world, this can be solved with cables and mixers, by splitting some output to other inputs and similar stuff, in a digital world this seems difficult and it’s complicated, for example, record the audio from the browser, or get the audio from skype or similar. There are some solution that I want to share with you, 2 out of 3 of them are completely free:

Soundflower

FREEWARE. MacOS system extension that allows applications to pass audio to other applications. Soundflower works on macOS Catalina. Follow the instruction at this link (official link) after a restart you’ll see 2 new output device available on your menu. You can set the output to soundflower and set soundflower as input, in your record software and done!

 

 

 

 

BlackHole

FREEWARE. BlackHole is a modern macOS virtual audio driver that allows applications to pass audio to other applications with zero additional latency. Follow the instruction at this link (official link). It works just like Soundflower: it adds a new virtual device Blackhole 16ch and you can use the input of Blackhole 16ch to get the audio of every app, just setting the output to Blackhole 16ch.


 

 

 

 

 

 

 

LOOPBACK

99$, 14 days trial. It creates virtual audio devices to take the sound from apps and audio input devices, then pass it to any audio processing software. With an easy-to-use wire-based interface, Loopback gives you the power of a high-end studio mixing board, right inside your computer. Details here while Loopback is not a free software, it has the power of super easy to understand user interface where you can configure multiple sources as a new virtual device.

And then you can use this new created virtual device in your recording software

My use case it’s something a little bit complicated than record from an internal source in my computer: I want to stream my webradio show from home, and have someone else talking with me in the show, but he/she is at home. What I’m using is MIXX a free software that can easily stream audio to shoutcast or icecast server, you can add multiple microphones (up to 4 microphones) so I want that Skype output is seen as a microphone, to do this I’ve installed Soundflower and used as output device in Skype

And set Soundflower 2ch as mic in MIXX

And it works! This is just a use case, but you can solve a lot of problem with these solutions. Then you probably want also and additional feature like: sending a source to two different device (for example real speakers and one of the virtual device) so that you can listen to what you are recording, or using as a source (the skype virtual microphone in my use case). This can be done using the built in Audio device of the Apple MAC, just open Audio device click on + button on the left bottom corner and select “create multi output device”

You can then select something like Built-in output (the speakers) and Soundflower output (set Drift correction, better result)

When Multi-output device is selected from the sound menu….

..everything that is sent to the Built-in output will also be sent to the Soundflower.

How to listen http webradio stream in an https site (Chrome > 80)

Since October 3, 2019 Chrome is gradually rolling out the new security feature that will block mixed content in the websites (info here). So that, if you have a webradio site in https and your streaming is in http, then none will listen to your webradio stream in your site. This is gradually happening at the beginning of 2020. There are multiple solutions, obviously the easiest and the smarter one is to move your streaming to an https connection. 

To do so you can ask your streaming provider to move/modify your server to a secure one. 

But this could take times, could be expansive or impossible (if your streaming provider service do not have this option). A good solution is to proxy the stream using a php script hosted in your website. So suppose you have a website at the address

https://www.myradiowebsite.com

And suppose your stream is at

http://mystreamprovider.mywebradio.com:someport/streamendpoint

Let’s create a file, let’s call it stream.php and let’s wrote in it:

<php?
$filename = "http://mystreamprovider.mywebradio.com:someport/streamendpoint";
header("Content-Type: audio/mpeg");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$filename);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 500);
curl_setopt($ch, CURLOPT_WRITEFUNCTION, function($curl, $data) {
    echo $data;
    return strlen($data);
});
curl_exec($ch);
curl_close($ch);

With the usage of the curl function in php, basically we are proxying the non-secure connection to the stream with the secure connection of your website. And we’ve also removed the cross-site problem (side effect: we’ve also hidden your streaming provider info, so that, none will know who is hosting your streaming service and can’t know the number of your listeners…). All you have to do now, is to modify in your website, all the references to the original stream so search/replace or configure your website according to this substitution

 

find http://mystreamprovider.mywebradio.com:someport/streamendpoint and replace with https://www.myradiowebsite.com/stream.php