Access/process system audio with Javascript/Web Audio API - javascript

Is it possible to access system audio using the Web Audio API, in order to visualize or apply an equalizer to it? It looks like it's possible to hook up system audio to an input device that Web Audio API can access (i.e. Web Audio API, get the output from the soundcard); however ideally I would like to be able to process all sound output without making any local configuration changes.

No, this isn't possible. The closest you could get is installing a loopback audio device on the user's systems, like Soundflower on OSX, and use that as the default audio output device. It's not possible without local config changes.

Related

How to play System Media Sounds

I'm developing an Desktop application using ElectronJS.
How can I play System Media sounds?
I know that for C# I can use
// Plays the sound associated with the Asterisk system event.
System.Media.SystemSounds.Asterisk.Play();
How can I do a similar call on ElectronJS?
As far as I am aware, there is no way to play a system sound using an Electron app directly. However, there are workarounds. You can ship with system sounds in your application and playing one depending on the OS your user is running, and shell beeps can be provided by importing shell from Electron and calling shell.beep();.
Another alternative may be detecting what OS is being used and pointing your media player at the relevant system sound file. This can be done with a hidden window that includes an HTML5 media player.

Reading output audio data from Spotify Web Playback stream

I am currently playing around with audio visualization and I am trying to work with Spotify's Web Playback SDK to stream and analyze songs directly on my site.
However, I am unsure what the limitations are when it comes to actually reading the streamed data. I've noticed that an iframe is generated for the Spotify player, and I've read that spotify uses the encrypted media extensions to stream the audio on chrome.
Is it even possible to read the music data from the Spotify api? Maybe, I can read the output audio from the browser?
According to the web API documentation, you aren't able to play back full songs and get the audio data like you desire (for obvious reasons). Although, 30 second "song previews" are allowed through URL streaming, as well as full song playback on desktop browsers (excluding safari at the time of this post), with the Web Playback SDK.
However on the mobile API it is now possible to get the raw PCM data (Android or iOS). This will require you registering for a developers account and setting up the access tokens if you haven't already done so.
For quick reference, on Android it involves using the AudioController class.
EDIT : Thanks to #Leme for the Web Playback SDK link.

Is it possible to video record the screen using MediaRecorder using javascript?

I would like to capture either part or the whole screen and record it as a video from a web page in javascript.
Currently, I can record video from a web cam with the built in MediaRecorder but I would like to know if it is possible to get screen output and use that as a stream for the MediaRecorder?
I'd like to know if there is a standard way to do this without using any 3rd party libraries? (I can record audio/web cam video in almost all the browsers as of 2018)
You can record Screen or Windows only using browser extensions (in Chrome for instance with these). Which as you can see they ask specific permissions to the browser.
Alternatively you can record content inside your web app using MediaRecorder. But unfortunately has a pretty limited support.
As you pointed out, stream from webcam is widely supported today.

record audio from browser and visualize in real time

I am looking for a package which will take input of audio from browser through microphone then visualize it in the real time.Any javascript package available to implement.I check most of the audio visualizer but they need audio file .I want the package should directly get it from microphone in browser and then show visualization.I am implementing it in the nodejs so need something in java script
Google search of "web audio api visualizer with microphone" should have obviously pulled some decent results for you :)
local microphone stream + Web Audio api + canvas are the main requirements here!
Start with this volume meter example that gets input from microphone using webrtc api and show some visuals in GUI
Explore more examples from https://webaudiodemos.appspot.com/

Javascript library for recording user audio?

This isn't another one of those "How can I record audio in the browser?" questions... I know that the HTML5 Stream API is around the corner and Flash can already access the user's microphone and camera. I'm simply wondering, as a Javascript developer with little knowledge of Flash, if anyone has developed a JS library that hooks into Flash's device capabilities for recording but sends the results back to javascript (presumably using ExternalInterface).
In other words... libraries like SoundManager2 utilize a Flash fallback for audio playback, but they don't seem to allow for recording. Has anyone written a JS library that uses an invisible Flash movie to allow audio recording?
This does most of what you're looking for:
https://code.google.com/p/wami-recorder/
It records audio and sends it to a server via an HTTP POST (avoiding the need for a Flash Media Server.) A JavaScript API is available via ExternalInterface.
I'm not sure why you'd want the audio bytes in JavaScript, but it would probably be easy to modify it to do that too.
Unfortunately, you can't really do Flash audio recording in browser only. The Flash audio interfaces are all designed (surprise surprise) to talk to a Flash media server (or Red5): there is no interface to store recorded audio data locally and pass the recorded audio data to Javascript.
Once you have Red5/FMS setup you can control the recording process from Javascript: you can start/stop/playback the audio stream to/from the server. However, for security reasons you have to have a flash movie that is a minimum of 216 x 138 (see http://blog.natebeck.net/2009/01/tip-of-the-day-tricks-of-the-mic-settings-panel/ for a writeup) otherwise the settings manager won't be shown: this prevents people hiding an audio recording flash widget on a page and eavesdropping.
So no, no invisible flash controlled from javascript.

Categories