In this recipe we are going to play back some WAV sound effects.
Load up PlayStation Mobile Studio and create a new project. Add a reference to Sce.PlayStation.GameEngine2D
. You will need a pair of WAV files to play as sound effects. The complete source for this example can be found in Ch4_Example7
.
Add the two WAV files to your project and set their Build Action to Content.
Open AppMain.cs and replace the existing code with the following code:
using System; using System.Collections.Generic; using Sce.PlayStation.Core; using Sce.PlayStation.Core.Environment; using Sce.PlayStation.Core.Graphics; using Sce.PlayStation.Core.Input; using Sce.PlayStation.Core.Audio; using Sce.PlayStation.HighLevel.GameEngine2D; using Sce.PlayStation.HighLevel.GameEngine2D.Base; namespace Ch4_Example7 { public class AppMain { private static Sound _machinegunSound; private static Sound _explosionSound; private static SoundPlayer _soundPlayerMachinegun...