BackgroundAudioAgent with a dynamic playlist - windows-phone-8

I am developing an app that has the capability of playing audio tracks streamed from a server. This app needs to be able to playback the audio even when the screen is locked or if the app is put in background.
=====
For background audio playback in windows phone, the Background Audio Agent is required.
The sample provided by Microsoft shows the basics: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202978(v=vs.105).aspx
In the sample, the background audio agent has a list of static tracks and when the user taps the skip/prev in the main project, it simply forwards it to the singleton BackgroundAudioPlayer object which in turn uses the event handler in BackgroundAudioAgent project to load the next/prev song.
BUT, what I would think a common usecase is that the main project will have the details of the play list (like a list retrieved from server) and we just need the backgroundaudio agent to forward that request to the main project.
My question is
Is there ANY way to forward the user action from audio agent to the main project so the main project can determine which track to play?
P.S: I cannot use MediaElement (which seemed to work fine in Window Store App and provides background support) because in Windows Phone SDK it has no background support.
EDIT: When the screen is locked, The application itself can be terminated even if the background agent is running, so I guess there no mechanism to forward the request to the app. This would mean, The background agent has to be self sufficient... Which would be a poor design to have to jump through hoops for a seemingly common behavior (Playing audio stored in remote server that requires authentication) .
At this point, I am considering writing all URL specific information to a file and have the background audio agent read that saved file and authenticate with server and create audio tracks. But the handshake to show the current audio information when the application resumes will be complex to say the least.
I hope I am wrong with this and there is actually a easier way than this. Would love to see how others have handled this.

Related

Streaming video in HTML5/JS

I currently have an IPTV subscription and as a fun little side project I decided to create a multiplatform IPTV app. However, I'm running into some trouble when trying to stream video.
The .m3u playlist I am currently using has streaming links, however they do not end in .m3u8 as I am usually accustom to.
When I do a get request to the link in insomnia, it begins to download content with a MIME type of video/mp2t.
I have tried using hls.js along with a few other html video players however I cannot seem to get it to work.
The playlist does work with VLC!
I feel like I am missing something, just not sure what.
Thanks!!
If your IPTV service has content that the service provider wants to restrict then they may encrypt the content, use DRM and/or obfuscate the access to the manifest files and segments streams.
The reason they do this is to ensure that only their apps can be used to playback the content - this does not always have to be just for paid services as the content owner may require the content to be encrypted even for free IPTV services.
You can still do your experiment and build your multiscreen project using test streams which are available online - there are both DASH and HLS online streams available in a number of places. see here for a useful list:
https://bitmovin.com/mpeg-dash-hls-examples-sample-streams/

Why Audio Transforming Functions and Audio Visualizations are not connecting to streaming source

I am working with Web Audio API and I combined two project repositories at GitHub to get a cool app that gets a streaming user input, transforms the input and provides an output for the user to download. I have a problem to connect the streaming voice with filters(pitch etc.), audio visualizations and a distortion filter. I am a student and I do not have much experience with audio API. Can anybody help me? (First Repository: https://github.com/mdn/web-dictaphone, Second Repository: https://github.com/urtzurd/html-audio/tree/gh-pages/static, My project Repository: https://github.com/PatrykWajs/web-dictaphone).
Thank you for your time.
I managed to combine both repositories as one project but I cannot understand why things cannot connect. I tried various things.
There Aren't Any errors. It seems like everything is working fine but streaming voice input is not connected to filters and visualization.
I think it is working just fine; however, you're getting hit by the autoplay restrictions. If you open up the developer console, you'll see a message that tells you so - the AudioContext will not go into playing mode unless it's created (or resume()ed) from within a user gesture (like a click handler). You can test this by going into the site settings (right-click the lock icon in the address bar, click "Site Settings") and set "Audio" to "Allow" instead of "auto".

Running HTML5 webkitSpeechRecognition API programmatically

I am interested in running the webkitSpeechRecognition API programmatically. I want to take an audio file that is uploaded to a server and use the webkitSpeechRecognition API on the back-end to recognize the text and return the result to the client.
One possibility is running some form of "embedded" version of Chrome, but I'm not sure how I would pass in the audio input. Another would be to use some form of C++ bindings to access the API, but I'm not sure if this is overly complicated.
Is this possible? How could this be accomplished?
I've done this before, but not on any large scale. I used this software,
http://vb-audio.pagesperso-orange.fr/Cable/index.htm
that I found from this link
Play audio as microphone input
With that you can recognize anything you play through your speakers, the program makes a virtual mic that streams audio from virtual speakers that it creates.
As far as your embedded version of chrome, you could try grabbing the chromium source and replacing the code where they read from the mic with code to read from a file, I don't know how far you are going to get with that though, I've never read that code.

ActionScript 3.0: Wait for response from Flash Player Settings window

I recently received some code from another developer and there's one piece I would like to rework. It's a flash app that works with mic and webcam. When it is started you are prompted to press a button - after that the usual flash player settings windows appears asking you to allow access to mic and cam. The application needs to wait for user's response on this question. It was achieved in the code I received in a rather awkward fashion. Application progressed on mouse movement event, which would not be registered since the flash player settings popup block the area. Once it out of the way - any mouse move would make application to go on. I need to rework with in some better way, because this piece of code is also used in AIR application that doesn't ask for allowance and, therefore, if you click the opening button you would need to move your mouse in order to get things running. I believe there must be some decent way to notify the app that settings popup is gone. Could anyone advice on this?
The correct way to do this in Flash Player is to listen for StatusEvent.STATUS event which is dispatched after the user either allows or denies you access to their mic. See the documentation for Microphone.getMicrophone().
In AIR, however, you don't have to ask for user's permission to access their mic and camera, so this event is not dispatched when your application gets access to the input device. In that case, you can check through Capabilities.playerType property if your code is running in AIR and then proceed with doing what you would have done in response to receiving permission to access user's input devices.

How to skip the security setting on flash player?

Can we skip the security setting (for camera permission) on flash player when we attached camera (by code) ? So every time we use the flash app, the permission is always 'allow'. Because I am using camera for local purpose only, so the camera images will not shared to others (standalone app, not web apps). So, the user must not click on it all the time.
Is it possible ?
Something you must understand is that Flash is a sandbox environment, you will not be able to change or influence any client side browser settings.
The best solution for this may be to inform the user via an alert to make sure that there flash security settings are set correctly.