Open the Soundflowerbed Application. It should be located in the Soundflower folder which should be in your Applications folder. A black icon resembling a flower should appear in the top right hand corner of the screen near the system time. Click on the Soundflowerbed icon click on the Audio Setup option in the drop down menu. The ATI HDMI Audio Device Driver is a software complement to your sound card. OS: Windows 7 Windows 8.
- Electron , Javascript , MacOS ,
- Tags: chrome, electron, javascript, macOS, soundflower
- 28 Sep
Buildingdesktop applications used to be tedious in the past. With each platform havingits own programming language, and a different way of doing things. Windows,Mac, Linux… We used to have java with “Swing” which was great and crossplatform, but building apps with this was not really fast. Then JavaFX came which was better. But nowadays, we have awesome tools which allows us toleverage the power and ease of use of web technologies to build desktop apps.Electron provides us such capabilities and what is awesome, is that it is crossplatform.
Audio Setup Software Flowering
Recently, we’vehad a situation where I needed to record system sound on a mac alongside video to channel the resulting stream over WebRTC. The application was adesktop app, and obviously built with electron. And as most of you might know,electron apps run chromium and leverages web technologies to build desktopapps.
The Problem: How to Record System Sound on MacOS?
To stream adesktop in real-time with audio and video on electron, you will need the “desktopCapturer”.Then, precise constraints as required by Electron. Though this approach will work on Windows, itwill not work on MacOS. MacOS will simply not allow the system audio tobe captured, but has no problem with allowing the video stream afterpermissions are granted. This is a bug that has been present for years now,this post is about how to handle this issue.
This is aknown issue and while searching, I came across several complaints about thisissue. Some date back to a few years ago. Here you can find an open issue about Chrome notproviding a possible means of recording system audio without external drivers.This report dates back to 2016, now as I’m writing this, we are in 2019. Diggingdeeper into this, I found that it was due to MacOS. The operating system didn’tallow system sound to be captured by default.
In myopinion, the fact that there is no proper solution to this is because thenumber of developers who need to implement system audio capture functionality intoelectron apps is not really significant. I also think it is important tohighlight a point about various solutions to this issue found online. Most ofthe solutions I’ve seen developers bring up, were hacks which aimed at mixingtwo streams from different sources and mixing them. That is, capturingvideo from the desktop, capturing audio from the microphone. Then mixing both. This is an example of what I’m talking about.Though this is the approach we are using in this post, we will get video andaudio streams both from the system.
The Solution
Aftertrying a bunch of possible solutions, we finally came across a final solution.Though it requires a fairly complex installation of third-party software, itworks and permits us to record system sound on MacOS. Let’s dive in.
If you like this post, you can chose to follow me on Twitter or Github and subscribe to this page’s notificationsto stay updated with new articles or like my page on Facebook.
Installing Sound flower:
Sound Floweris an extension to the MacOS kernel, it is open source and it’s made to createa virtual audio output device on MacOS. To install soundflower, you need tofollow these instructions. I recommend you follow theinstructions attentively till the end. Because, after installation, you have tosetup the software so as to enable it to capture MacOS audio.
After the installation of SoundFlower, you can notice with your JavaScript that new audio output devices appear in the OS. As you can see below. The audio output device highlighted is the one we are interested in, and which we will use to record sound system on macOS.
Record System Sound on MacOS with Video
Here arethe steps we will use to record the system sound.
- Getevery media device on the computer
- Filterthese media devices and get only the sound flower audio output device wehighlighted above,
- Extractthe audio stream from the sunflower virtual device we filtered out.
- Atthis point, you have succeeded in recording system audio on MacOS, but we willadd Video to it.
- Extractthe video stream
- Mixthe Video stream with the previous audio stream
- Getthe resulting stream and perform what ever you want with it.
Here is thecode performing the steps I mentioned above:
Audio Setup Software Flower
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 | .then(devices=>{ //... //We filter the device which we are willing to get returndevice.kind'audiooutput'&&device.label'Soundflower (2ch)'&&device.deviceId!='default' //We get the user media corresponding to the audio device we are willing to get audio:{ } })//The next step is to get audio stream from the sunflower virtual device, //then mix it with the video stream we are already getting. navigator.mediaDevices.getUserMedia({ video:{ chromeMediaSource:'screen' } let audioTracks=audioStream.getAudioTracks(); if(audioTracks.length>0){ } //... Now you have a video stream with the appropriate audio stream 'do what you want with it !!!' }) |
You might be interested by this post about building offline web applications with Javascript using Service Workers and IndexDB.
Conclusion
We have seen how to record video, alongside system sound on MacOS with Javascript. Though this method works well, you can tweak it so that it get’s only sound or so it does whatever you want. If you have a method which is more efficient in recording sound and video in with JavasScript, please share in the comments section.
Audio Setup Software Flowery Branch
References
Audio Setup Software Flowers For Algernon
Device presets
Your MOTU pro audio interface can serve many functions in a variety of scenarios. These presets instantly configure the device for common tasks. For example, if you want to use your device as an audio interface for your computer, just choose the Audio Interface preset. These videos explain each preset, what it can be used for, and how it works.
Preset basics (1 of 6)Explains device presets, and shows you how to work with individual presets for the routing grid, mixer channel strips, and effects modules like the reverb processor. | Audio Interface preset (2 of 6)In the Audio Interface device preset, the routing grid routes audio from the physical inputs and outputs on the interface to your computer. This video explains how this is done in the routing grid. |
Interface+Mixer preset (3 of 6)The Interface+Mixer preset is ideal for live tracking sessions where you need to record tracks into your DAW and also supply no-latency monitor mixes to musicians. | Stand-alone Mixer preset (4 of 6)In the Stand-alone Mixer preset, the routing grid maps all inputs to the on-board mixer, which mixes them to the Main Mix and Monitor Mix. |
Stage I/O preset (5 of 6)In the Stage I/O preset, the routing grid maps audio inputs to the network, and incoming network streams are routed to the outputs. This allows two devices on the network to stream audio to each other. | Expander preset (6 of 6)In the Expander preset, the routing grid maps analog inputs to ADAT outputs; conversely ADAT inputs are mapped to analog outputs. This allows the interface to extend the analog I/O of another optical-equipped device, such as another audio interface or mixer. |