createjs SoundJS plays mono sound instead of stereo - javascript

I use createjs.Sound to play short sound for my project. I wasn't able to use .mp3 format file and converted it to .ogg format. .ogg is playable, but sound is mono channel (I hear only in one side of headset). When I tried to play same file with VLC player, it sounds stereo channel (same file). I understood that have no problem with conversion of file and problem may be in configuration of SoundJS.
Can anyone advice how to configure SoundJS to play stereo channel audio?

There was a bug in a version of SoundJS - maybe it's because of that (depends on the version you are using...). Check the SoundJS-Github page for further information: https://github.com/CreateJS/SoundJS/issues/182
You can also try to change the pan property: http://www.createjs.com/docs/soundjs/classes/AbstractSoundInstance.html#property_pan

Related

Is there any way to play .flv files using HTML/JavaScript?

my client is very keen on playing .flv files on his website. Is there any way at all to play them? Doesn't matter if it's a dirty/hacky way.
Other similar questions are outdated.
There's some open-source FLV players like flv.js.
Your FLV must contain H.264 video codec and MP3 / AAC audio (since those codecs are supported by HTML5/browser decoders).

Record webRTC stream in mp4 using kurento media server

I am working on recording the video stream using WebRTC and Kurento Media server. The recording is working fine, but I am facing an issue.
The browser is storing the media in Webm format, which does not keep the metadata information. If I am recording a mobile webRTC stream in portrait mode, then the Kurento is recording that stream, but when I am playing that video, it's being played in landscape mode everywhere.
I have done some R&D on it and found the Webm does not keep the metadata information, so I have record the video in mp4 format.
I have read the documentation of the Kurento media server but didn't found anywhere that how to record the video in mp4 format.
Can anybody tell me how we can do that?
I have tried the following things
- Changed the file extension to mp4
Please try mentioning the recorder end-point profile spec (webm, MP4, MKV)
You can post your code as well so that corrections can be suggested.
You can also follow this code https://github.com/Kurento/kurento-tutorial-js/blob/master/kurento-recorder/js/index.js
At line number 112 you can include profile based on the specs used in kurento-utils.js

Is it possible to get a stereo audio feed into Chrome?

For instance, if I have a stereo audio interface/sound card, could I get the left and right channels separately into javascript for realtime-ish audio processing of stereo audio?
I think it's actually not possible to get stereo audio into Chrome. According to the following URL: https://bugs.chromium.org/p/chromium/issues/detail?id=453876
Unfortunately we don't support [...] multiple devices at the moment.

HTML5 Video element not playing an .mp4 with no audio codec

I'm trying to upload a video to a Angular app using ng-file-upload. All works fine until I try and upload a .mp4 video with no audio codec. The video element shows, it shows the correct duration in the control panel, it just doesn't play. Clicking play does nothing, the first frame is not shown.
If I upload any other .mp4 that contains audio the video plays without error.
Below is the information I can see about the file that is failing, as you can see only the video codec is listed for this file.
Here is the 'more info' for another .mp4 file that has audio, this one uploads perfectly fine and plays in the HTML5 video element with no errors.
As you can see, the video that works states the audio codec as AAC, which is expected for .mp4, and shows Audio Channels "2", i'm unsure of the purpose of 'Audio Channels' is in all honesty.
I've been debugging this thing all day and the only difference in files that I can see is in the above images.
Should HTML5 video player play a .mp4 video without any audio codec listed?
What leads me to think the audio has a role to play in this is w3schools description of an Mpeg-4 file:
MP4 = MPEG 4 files with H264 video codec and AAC audio codec
Has anyone had this issue before?
Edit
After adding a listener to the error event on the video I can see that I get a MediaError object with code 3 as a value, so this is a decoding issue I can see.
Screenshot below
Further edit
I've now debugged this as far as going into Chromes 'media-internals' logs. The error Chrome is encountering is now confirmed to be because of the missing audio, see the screenshot below:
Unsure why an error isn't clearly thrown because of this. Is this the end of the line, it's weird because if I upload the video to Facebook it uploads just fine.
I'd advice you to check if the .mp4 file is properly converted. I've already checked it on my computer and it should be normally played - just video with no audio (Ubuntu 14.04, Chrome 51.0.2704.106).
Use ffmpeg to check the available media tracks:
ffmpeg -i input_file.mp4
Then try to use the source with audio track and convert it to one without an audio. This command will remove all audio tracks:
ffmpeg -i input_file.mp4 -vcodec copy -an output_file.mp4
HTML5 specification doesn't tell what should happen when we don't have a proper codec for one of the media tracks. Just for reference - HTML5
It's always a good idea to check the playback on any other player, VLC is a good one for reference.

Best option for streaming audio in-browser, for mobile too?

I'm trying to find a solution for my website which desperately needs an upgrade. Currently I am using Flash-based players to stream content from Shoutcast, which doesn't work too terribly, but unfortunately it leaves mobile users behind.
Ideally, I would love to have an HTML5/Javascript player that can play Shoutcast (or other) streams online. I've tried jPlayer, which seems pretty good for playing individual files, but have been unsuccessful in trying to get it to work with Shoutcast and Icecast.
Does anybody have any suggestions on where to start?
You can use jPlayer to play your shoutcast stream using HTML5 native player - it works quite well on most browsers/platforms except android. In that case jPlayer provides the flash player backup.
You need to specify your type of audio as 'mp3' (aac streams do not work so make sure you are specifying a straight icy mp3 stream) I have used 'mp3' but you can also try type 'stream'
You need to change the url of your stream slightly:
Normal: http://yourserver.com:8000/listen.pls
jPlayer: http://yourserver.com:8000/;listen.pls
(note the addition of the semicolon - this helps with shoutcast servers)
Here is the documentation from the jPlayer site that should help as well.
http://www.jplayer.org/latest/demo-08/
Happy Streaming!

Categories