Run chrome in background while running audio - google-chrome

I have an audio clip playing on localhost:3000 on a node (js) server. I want this audio to keep playing even after i close the chrome tab. How can i go about this?

Related

Media Recorder Chrome; Opentok audio not captured

looking for assistance from anyone who might have some insight into this. having a problem with the MediaRecorder API built into Chrome, specifically on macOS, a problem that does not appear at all on windows
i am needing to capture the desktop screen as well as the desktop audio, and currently i get the stream using:
navigator.mediaDevices.getDisplayMedia({
video: {
cursor: 'always',
width: 1280,
height: 720,
frameRate: {
ideal: 12,
max: 15
},
},
audio: true
})
this of course gives the prompt for the user to select a screen/application/tab
following that, i load that into a new MediaRecorder:
new MediaRecorder(screenCaptureStream, {mimeType: "video/webm"})
on windows this all works fine. as long as the "Share Audio" checkbox on the bottom left is marked, audio will be heard in the ending file.
on mac however, the only time a "Share Audio" option is allowed is when a chrome tab is selected. this is fine for something like a youtube tab playing music, it captures both video and audio without a problem.
however, on a tab running an opentok video session, no audio coming from the video session is captured. at first i thought it may have been ffmpeg incorrectly processing it, but simply playing back the raw webm file gives no audio. checking with mediaInfo the file does indeed come back with an audio stream at "48.0kHz, 32bits, 1 channel, Opus"
because this isnt a problem on windows, i imagine that the Opentok video session is somehow outputting in such a way that it it bypassing the chrome tab altogether, so that even is the user can hear the audio, the recorder doesnt capture it.
does anyone know how to allow chrome to record audio on the Application/Screen choices on macOS?
EDIT: upon more experimentation, ive discovered that the issue lies in tokbox streams themselves.
setup: using a second pc, i hooked up my phone to a line-in port to use as the "mic" for the tokbox stream, and started up the session again. on that same page i have a youtube embedded iframe link to a random video, and on firefox, another video entirely.
selecting entire screen and making sure "Share Audio" is selected, i check that i can hear the audio being played from the phone on the other pc and its fine. the recording is going, and the checks for if there is an audio track pass. i swap to the next audio source by muting the 'phone' stream, and start playing the youtube embed. after a little bit, i stop it, and play the firefox video.
the results are that the embed and firefox audio got captured, but NONE of the tokbox audio got captured. (this was done on windows, so now i know its not a mac issue)
where is it being outputted?

How to set a breakpoint where a sound plays

I want to find out where in a webpage's source code does a sound effect play. That'd allow me to better understand the code and obtain the audio file as well. I searched in the "Sources" and "Network" tabs of the Chrome Inspector, but there are no audio files there. The sound is probably fetched by an AJAX request or generated using the HTML5 Web Audio API. How do I set a breakpoint in the Chrome Debugger to pause when a sound plays?
As suggested in Abarnett's comment:
Use a browser add-on/extension/plug-in such as Chrome Audio Capture to record internal sounds in the browser.

Can't play mp4 from web-server, plays fine from file://

I've tried this running a few simple servers, beefy.js and static-server, both simple node servers.
My problem is that when I load my video via an http:// in a video element, or via a relative path on the local web-server, it doesn't play. I get no errors.
I've checked the address is correct by providing an incorrect address which gives me an error in the console.
If I give chrome a file://LOCATION_OF_MP4, chrome will play the video no problem.
If I go to http://localhost:9080/relative-location.MP4, I get a black screen with player controls and a muted sound.
I can't figure out why the local version should be fine, but the server-based can't be found.
I'm creating the video tag via
var vid = document.createElement('video');
console.log('src', state.demoVideo.store.src());
vid.setAttribute('src', state.demoVideo.store.src());
document.body.appendChild(vid);

Playing local mp4 in browser (chrome)

Just trying out some very basic playing around with HTML5 video, and I can't seem to get the most simple of things working, getting a local mp4 to play in my browser.
I tried an mp4 I had myself but then thought the file might be the problem so now I am literally just trying to play this video in Chrome. I've downloaded it, and I know the path is correct because I've dragged it right into the browser. However, it just displays a black box with the play button greyed out.
What's going on here?

HTML5 audio stream stops after each song

i have an icecast server serving continuous mp3 stream. i tried to play it in html5 with the audio tag. in safari it shows up and plays, but the moment the song changes, the stream stops and will not start again, even it i press the play button.
does anybody know a way around this?
This is a known Firefox Bug “Firefox fails on chained ogg stream” #455165 and should be fixed in Firefox 20.
Update: Sorry, didn't saw that you said you are streaming mp3. Firefox might have similar issues with mp3 too…