Play game sound effects - windows-phone-8

How can I play sound effects in a game created with the universal app template (so it runs on both Windows 8.1 and Windows Phone 8.1) programmatically?
I need to play the sound from a GameManager class I've created.

Note that MediaElement is designed mostly to play a single audio track so you'd need to manage a pool of these to play more than one at a time and also its latency might not be low enough. I'd look into XAudio2 if you'd be OK with some C++ or its SharpDX wrapper for C# or just use MonoGame's SoundEffect class that makes things easy.

Related

Increase rendering speed in flash

I am building a flash application ,am running the app in .net form using the official adobe plugin. it takes huge memory and CPU, i am wondering why the flash is still laggy.
I have set wmode=gpu but still am not getting a smooth play.
Try updating Flash Player ! that might have been an issue , if you are using .net form , then update the flash player of IE so that it will be updated in the form !

windows phone 8.1 music library get current media queue

How to get current media queue in windows phone 8.1 (runtime) as in windows phone 8 MediaPlayer.Queue
Is it available or we have to implement?
Similarly IsShuffled functionality is there ?
The MediaPlayer API belongs to the Microsoft.Xna.Framework.Media namespace which is no longer available for WinRT components. So you can't use it but you can implement your own logic for it using the MediaElement API which has sufficient properties for a media player except for the logic of queuing etc.
The explanation here and the msdn-code-sample would surely help you out.
For background music player you should use the SystemMediaTransportControls API and attach the events that occur when your app is running in background.
This link has a background audio explanation. Seems helpful.

Can I generate a FirefoxOS App from game written using starling framework?

A friend of mine has developed an excellent game using the starling framework. He is now wondering if he could port the game to FirefoxOS before he launches. The game is written in actionscript 3 and the starling framework project can build mobile packages for android and ios. It also can generate the flash file for the web (using flash player). Are there any paths for porting the game to FirefoxOS?
Someone suggested using shumway. If you know about this way, or any other path, please give a bief account of advantages/disadvantages. I am specially concerned about the performance, since the game in question has very high quality graphics. I think it needs to run in a GPU accelerated environment.
EaselJS uses a similar syntax to ActionScript; it has a Display List, Stage, Graphics and even Filters, this will make working with the canvas easier for us Flash developers.
I suggest you to port that game to EaselJS and TweenJS (both from CreateJS), I have used it to develop games for Firefox OS and worked quite well.
An advantage is that CreateJS now uses a WebGL renderer, but it also has a fall back to Context2D rendering if WebGL is not available. That would make your device more widely supported.
You will find all its features very explained in the following post from Mozilla Hacks. It has also some cool benchmarks to try it.
WebGL and CreateJS for FirefoxOS

XNA Audio and WASAPI conflict?

I've recently been working on integrating some code for a VoIP application. On one end, the UI (mainly the dialer) uses the XNA Audio framework to play sound bytes (DTMF) on button presses. On the other hand, the actual call module uses WASAPI for capturing/rendering audio. After integrating the parts, I was seeing an AUDCLIENT_BUFFER_SILENT flag during the call, and no audio was getting through. I disabled all traces of XNA and tried again, only to see the call work just fine (no silent buffer flag present).
Do XNA and WASAPI not play nice? Is there a way to keep using XNA for the sound bytes and WASAPI for calls?
Just to tie things up here -- Microsoft has stated that while XNA is still available on WP8, it has been officially deprecated. So, assuming the problem stems from cross API headbutting, the answer is to use another API. I found that using MediaElements is a suitable replacement for the XNA sound effects.

Is it possible to monitor or change the system audio volume in Adobe AIR?

I am making a game in AS3 / Adobe AIR that requires the user to react to certain sounds. Is there a way to inform the user up front if the system volume is muted? Moreover, is there a method to change the volume? If not, does an external cross-platform application exist that lets me monitor the volume and that I can call from Adobe AIR?
The only access you may have to sound volum is restricted to the application (Flash player or AIR). You can change it with SoundMixer.soundTransform.volume for the general volume or SoundChannel.soundTransform.volume for a specific sound.
To summerize, you can't access the OS sound manager's settings or state with Flash. That's why many flash websites start with a message asking the users to switch their speakers on.
Native Extensions is the way to go.
You can follow an Adobe tutorial: http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt1.html
Or download them ready made: https://github.com/nweber/SystemVolumeNativeExtension