How to play MP3 files into the microphone input jQuery - javascript

I am attempting to create it so when a user plays a sound, it plays the sound to the users microphone input. Thus when they're in a Skype Call/Game chat/etc it will be played for all users to hear.
Is there any way to play music to the microphone instead of speakers in Javascript/jQuery? If not, does node-webkit give me any more ability to do this?
Hopefully this is well explained, it is a little challenge.
Thanks for any, and all advise!

This is not possible from the web browser alone. Most systems aren't even capable of this directly.
It is up to the client to decide how to route audio and there is no control of this within the browser, except for what happens within the page itself.
The best you can do is to recommend to your users how to configure their systems. For your Windows users, they will need a virtual audio loopback driver. http://vb-audio.pagesperso-orange.fr/Cable/

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.

Is there a way to get the audio playing from the speakers of a device

So I've been battling with an issue for a while now, I've been trying to get the audio playing through the speakers of a device using the MediaDevices singleton object in javascript.
I'm trying to achieve something similar to Shazam or snapchat where they can both get the audio playing from the speakers of a device and also from a microphone so that I can for instance be taking a video using my microphone and video cam and also streaming the sound playing from the background.
I'll like to know if this is possible because I tried using devices with kind of "audiooutput" and deviceId of "default" accessible through the enumerateDevices method assuming that's the device's output speaker but I still get the audio from the microphone even when using the device kind of "audiooutput".
Note: I'm able to combine multiple audio nodes successfully.
I'm not asking for a do it for me answer, just a theory of how to go about implementing it if it's possible in javascript.
Thanks in advance :D
No, this isn't possible via the Web Audio API. Not all platforms even support this capability.
On some platforms, you can use getDisplayMedia() and get audio with it, but compatibility isn't great right now.

Streaming/playing the video from the user's filesystem

The user has a video file on his system. Now, on the webpage there is an option to select a video file from his computer itself. I am seeking a way to directly stream the video on a html5 video tag(or any other player for that matter) from his/her computer on the fly. Please help.
This is a bad question and I do not see any effort from your part. Please check how to pose a question: https://stackoverflow.com/help/how-to-ask
Assuming you only need to support Web Browsers that support HTML5 then try
WebRTC (http://www.webrtc.org/home)
WebRTC is a free, open project that enables web browsers with
Real-Time Communications (RTC) capabilities via simple JavaScript
APIs. The WebRTC components have been optimized to best serve this
purpose.
It is important to note that this is just my personal preference.
Edit:
If you want to steam a file then take a look at VideoLAN (or VideoLAN Server). http://www.videolan.org/index.html

Limiting video record length for input type file on mobile devices

I'm using the file recording capability for a mobile web app I'm building:
<input id="file-camcorder" type="file" name="camcorder" accept="video/*" capture="camcorder"></input>
I'm wondering if there is a way to somehow limit the length of the video that gets recorded, or to somehow notify the user that their recording is taking too long. The problem is that when you choose to record on a mobile device, you are taken away from the web app, so I don't know of any way to interact with the user while they're in the phone's native recording app.
If anyone's got any ideas, that'd be great. Thanks!
You will probably have to look into hybrid applications such as Phonegap. HTML 5 alone has a relatively limited access to the device's functions.
Someone mentioned checking the video size or length from the metadata afterwards. That is most likely your only option, if you can not use, say, Phonegap.
To read the metadata, you can use FileReader.
Maybe you could try using the html5 tag, attaching your phone's camera video stream as source of the video using getUserMedia like this, and then capturing images from video stream with some delay for a limited number of times (or even prompt the user that they're recording too long after you reach a certain number of frames). Try skimming this and see if it solves your problem.

Are there any programs to record through a microphone that work inside a web browser?

I had a someone ask me if it were possible to record a person's voice inside of a web-browser - similar to what can be done on many operating systems. Is this possible through javascript or flash? Are there any programs that let you do this, and have the wav/mp3 of the recorded audio uploaded to the server? I'd prefer the solution to not use Flash if it can be avoided.
Thanks
You could use WAMI-Recorder. It still uses flash, but is designed to work with Javascript and data can be sent with HTTP POST. However, there's no way to access the microphone with Javascript alone.
At the moment, Chrome is the only browser that supports x-webkit-speech which is what they use to allow users to use voice to search Google on their desktop. HTML5 has getUserMedia, but support for that is also minimal and if your project is for mass consumption then it's unlikely to be a suitable.
Hey check out this post where i replied to a guy with a similar question as you.
How do I embed a Flash audio recorder in my site
I have done extensive research into client side only microphone recording and could not come up with any solution other than flash. If you follow my correct answer in the thread i posted, you can record audio from a microphone on the client side and then you can modify the code yourself and upload the audio to your server, its not that hard just a simple POST call.
If you do find a non-flash way to record let us know!

Categories