Exemple #1
0
        public void PlayBgm(AudioClip clip, float introTime)
        {
            SoundData data = new SoundData(clip, SoundPlayMode.NotPlaySame, DefaultVolume, true);

            data.IntroTime = introTime;
            System.Play(IdBgm, IdBgm, data, 0, DefaultFadeTime);
        }
Exemple #2
0
 /// <summary>
 /// SE停止
 /// </summary>
 public void PlaySe(AudioClip clip, float volume, string label = "", SoundPlayMode playMode = SoundPlayMode.Add, bool isLoop = false)
 {
     if (string.IsNullOrEmpty(label))
     {
         label = clip.name;
     }
     System.Play(IdSe, label, new SoundData(clip, playMode, volume, isLoop), 0, 0.02f);
 }
Exemple #3
0
 /// <summary>
 /// SE再生
 /// </summary>
 /// <param name="file">サウンドファイル</param>
 /// <param name="volume">再生ボリューム</param>
 /// <returns>再生をしているサウンドストリーム</returns>
 public void PlaySe(AssetFile file, float volume, string label = "", SoundPlayMode playMode = SoundPlayMode.Add, bool isLoop = false)
 {
     if (string.IsNullOrEmpty(label))
     {
         label = file.Sound.name;
     }
     System.Play(IdSe, label, new SoundData(file, playMode, volume, isLoop), 0, 0);
 }
Exemple #4
0
 public void PlayVoice(string characterLabel, SoundData data, float fadeInTime, float fadeOutTime)
 {
     CurrentVoiceCharacterLabel = characterLabel;
     data.Tag = TaggedMasterVolumes.Exists(x => x.Tag == characterLabel) ? characterLabel : TaggedMasterVolumeOthers;
     System.Play(IdVoice, characterLabel, data, fadeInTime, fadeOutTime);
 }
Exemple #5
0
 public void PlayAmbience(AudioClip clip, bool isLoop, float fadeInTime, float fadeOutTime)
 {
     System.Play(IdAmbience, IdAmbience, new SoundData(clip, SoundPlayMode.NotPlaySame, DefaultVolume, isLoop), fadeInTime, fadeOutTime);
 }
Exemple #6
0
 public void PlayAmbience(AssetFile file, float volume, bool isLoop, float fadeInTime, float fadeOutTime)
 {
     System.Play(IdAmbience, IdAmbience, new SoundData(file, SoundPlayMode.NotPlaySame, volume, isLoop), fadeInTime, fadeOutTime);
 }
Exemple #7
0
 public void PlayBgm(AssetFile file, float volume, float fadeInTime, float fadeOutTime)
 {
     System.Play(IdBgm, IdBgm, new SoundData(file, SoundPlayMode.NotPlaySame, volume, true), fadeInTime, fadeOutTime);
 }
Exemple #8
0
 //************ BGM ************//
 public void PlayBgm(AudioClip clip, bool isLoop)
 {
     System.Play(IdBgm, IdBgm, new SoundData(clip, SoundPlayMode.NotPlaySame, DefaultVolume, isLoop), 0, DefaultFadeTime);
 }
 public void wiad(NewTextMessage ntmess, NewMessage mess, System.Media.SoundPlayer player, 
     TextBox tbWiad, ListBox lbWiadomosci, TextBox tbDo)
 {
     ntmess.write(con, tbWiad, values["text1"] + " do " + values["text3"] + ": " + values["text2"]);
     ntmess.write(con, tbWiad, "--------------------------------------------------------------------------");
     mess.show(con, lbWiadomosci, values["text1"].ToString(), values["text2"].ToString(), 2);
     FillTo uzupelnij = new FillTo();
     uzupelnij.fill(con, tbDo, values["text1"]);
     player.Play();
 }
Exemple #10
0
        /// <summary>
        /// Play single sounds
        /// </summary>
        /// <param name="soundPlayer">The soundPlayer used to play the sound.</param>
        /// <param name="stream">The sound stream to play.</param>
        private void PlaySound(System.Media.SoundPlayer soundPlayer, System.IO.Stream stream)
        {
            if (stream == null)
                return;

            soundPlayer.Stream = stream;
            soundPlayer.Stream.Position = 0;
            soundPlayer.Play();
        }