Beispiel #1
0
        public static float SetGroupVolume(AudioChannelGroup group, float value)
        {
            float oldVolume = groupVolumes[(int)group];

            value = Mathf.Clamp(value, 0, 1);
            groupVolumes[(int)group] = value;
            PlatformAudioSystem.SetGroupVolume(group, value);
            return(oldVolume);
        }
Beispiel #2
0
 public static Sound Play(string path, AudioChannelGroup group, bool looping = false, float priority = 0.5f, float fadeinTime = 0f, bool paused = false, float volume = 1f, float pan = 0f, float pitch = 1f)
 {
     if (group == AudioChannelGroup.Music && CommandLineArgs.NoMusic)
     {
         return(new Sound());
     }
     return(PlatformAudioSystem.Play(new PlayParameters {
         Path = path,
         Group = group,
         Looping = looping,
         Priority = priority,
         Paused = paused,
         Volume = volume,
         Pan = pan,
         Pitch = pitch
     },
                                     fadeinTime));
 }
Beispiel #3
0
 public AudioPlayer()
 {
     stream = new MemoryStream();
     sound  = PlatformAudioSystem.Play(stream, AudioChannelGroup.Music);
 }
Beispiel #4
0
 public static void Update()
 {
     PlatformAudioSystem.Update();
 }
Beispiel #5
0
 public static void StopGroup(AudioChannelGroup group, float fadeoutTime = 0)
 {
     PlatformAudioSystem.StopGroup(group, fadeoutTime);
 }
Beispiel #6
0
 public static void StopAll()
 {
     PlatformAudioSystem.StopAll();
 }
Beispiel #7
0
 public static void ResumeAll()
 {
     PlatformAudioSystem.ResumeAll();
 }
Beispiel #8
0
 public static void PauseAll()
 {
     PlatformAudioSystem.PauseAll();
 }
Beispiel #9
0
 public static void ResumeGroup(AudioChannelGroup group)
 {
     PlatformAudioSystem.ResumeGroup(group);
 }
Beispiel #10
0
 public static void PauseGroup(AudioChannelGroup group)
 {
     PlatformAudioSystem.PauseGroup(group);
 }
Beispiel #11
0
 public static void Terminate()
 {
     PlatformAudioSystem.Terminate();
 }
Beispiel #12
0
 public static void Initialize(ApplicationOptions options)
 {
     PlatformAudioSystem.Initialize(options);
 }
Beispiel #13
0
 public static Sound Play(PlayParameters parameters, float fadeinTime = 0f)
 {
     return(PlatformAudioSystem.Play(parameters, fadeinTime));
 }