playing audio with SoundJS in Intel XDK - javascript

I'm playing audio in my HTML5 app using:
createjs.Sound.play('boom-sound');
I then imported the project to Intel XDK. Now the game is playing smoothly in the emulator but the no sounds are there. I also tested after building the app for android and no audio was there.
Any idea, anyone?

soundjs does not work that well, I've also had problems making it play sound on IOS devices in the past. To fix this problem I now use howler.js.

SoundJS has run into trouble in environments like Intel XKD and PhoneGap because it defaults to using the WebAudioPlugin. While Web Audio may be available, it needs to load audio through XHR which will not work with local files.
Loading files from an external server would get around this, but require the app to fetch data which is less than ideal. Using createjs.Sound.registerPlugins([HTMLAudioPlugin]) would get around this but HTML audio playback is sometimes limited on mobile devices.
Luckily, SoundJS recently added a CordovaAudioPlugin, and since Intel XDK is based on Cordova this should give you full SoundJS functionality. You'll need to grab the plugin and the latest SoundJS-NEXT from github. Then you can setup the plugin with registerPlugins
createjs.Sound.registerPlugins([CordovaAudioPlugin]);
Hope that helps.

Related

Recording audio from user on android chrome dosent play and gives empty blob in react.js

I am attempting to record audio samples from user on a PWA app. This application runs great on my Mac with the blobs being full in data. There is no problem in running the audio on the Mac. When running the PWA on my phone, blobs have 0 size, and nothing happens when running the audio.
React.js is used for the PWA. Before updating my chrome to the latest version(78.0.1304.108) the recording consisted of no problems. After the upgrade, attempts to find a solution failed. Phones with older versions work.
The following packs and JavaScript libraries were used (React-Mic,#cleandersonlobo/react-mic,React-Audio-Recorder),(getUserMedia,MediaRecorder)
Ok so I solved this issue, it turns out I used all audio inputs stream that chrome allows and because chrome dosent display an error regarding this it was hard to find it, so all I did was just redirecting the input streams better.

iOS PWA Audio Restrictions

I'm making a platform which involves the server triggering Audio to be played with Socket.io. I'm trying to make a PWA for iOS using similar code, but it just doesn't work and I've heard that Safari requires user interaction (I am using this with the full screen PWA meta tag, not through Safari directly). It works fine on the latest version of Chrome on desktop.
Is there anyway to make this work?
Web Interface (uses same audio
playing and socket.io code): https://github.com/archiebaer/bithop-web-interface
No, Safari restricts audio playing quite a lot. It seems in your scenario, there is no work around unfortunately.

Android javascript audio not working

I am writing a Cordova application, and I am not able to play sounds on a 4.2.2 Android device.
I have tried the 2 things mentioned here, that is PhoneGap's Media class (not working) and this syntax (not working):
var audio = new Audio('coins.mp3');
audio.play();
I have also tried this plugin but without success.
Also the workaround mentioned in code.google.com (using Video instead of Audio) does work when I am in debug, but not after deploying the app to the store and then downloading it:
var success = document.createElement("video");
success.setAttribute("src", "success.mp3");
success.play();
So it is not possible to play audio with javascript on older Android devices?

Capturing photo , audio and video from web application

I am making a web application which has the functionality of capturing the photo, audio and video. Till now i have considered the JQM and Sencha framework.
For photo i am able to directly open a camera using Sencha and it works great. But for audio and video i am not able to find solution like photo. Does anyone has done this? or have an idea how can this done?.
I am aware this can be done via Phone-gap but that is for the Hybrid App (native + html5) app i want to do it for browser.
There is no API in html 5 that will allow you to acces the camera/microphone directly in iOS.
Since iOS 6 there is only the option the upload an photo via the input tag.
You could try getUserMedia.
Supports is still sparse though - see here
Tutorial - see here
I highly recommend using Media element. I've built entire JQM mobile solutions using the video player capabaility, and audio.
http://mediaelementjs.com/

Recording a Call in PhoneGap?

Are there any Plugins available for Recording a Call in Android using PhoneGap? Or some guidance on how to implement it!
Thanks.
I don't think that this is possible at all. I hope the phone will protect the calls from beeing recorded by any app.
This is not a matter of phonegap.
edit
I found some apps, that can record calls at android phones.
Basicly it would be like audiorecording:
http://docs.phonegap.com/en/3.0.0/cordova_media_capture_capture.md.html
The only thing would be to detect the phonestate. Now the trouble may start, because your app is send to background and maybe will be paused.
There's not one that I can find.
Here's the documentation on creating a plugin for phonegap 3.x:
http://docs.phonegap.com/en/3.0.0/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide
And here's a tutorial on writing a plugin for phonegap 3.x:
http://devgirl.org/2013/09/17/how-to-write-a-phonegap-3-0-plugin-for-android/
You'll need to have this file stucture
src
android
ios
www
plugin.xml
You can also put more platform folders inside of src depending on which ones you want to support. plugin.xml includes all of the instructions for phonegap to be able to automatically install the plugin for each supported platform.
Here is an example of a plugin that's been upgraded to Phonegap 3.x.

Categories

Resources