当前位置: 首页>>代码示例>>C#>>正文


C# ISound类代码示例

本文整理汇总了C#中ISound的典型用法代码示例。如果您正苦于以下问题:C# ISound类的具体用法?C# ISound怎么用?C# ISound使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISound类属于命名空间,在下文中一共展示了ISound类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnPlay_Click_1

        private void btnPlay_Click_1(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = Application.StartupPath + "\\musicas\\";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                btnPause.Enabled = true;
                btnPlay.Enabled = false;
                btnStop.Enabled = true;

                ISoundEngine engine = new ISoundEngine();
                StreamReader rd = new StreamReader(openFileDialog1.FileName, true);
                List<String> arquivo = new List<string>();
                while (!rd.EndOfStream)
                {
                    arquivo.Add(rd.ReadLine());
                }
                String nomeMusica = arquivo[0];
                String caminhoMusica = Path.Combine(Application.StartupPath + "\\media", arquivo[1]);
                frases = new List<Frase>();
                arquivo.RemoveRange(0, 2);
                foreach (String frase in arquivo)
                {
                    String[] componentes = frase.Split('#');
                    frases.Add(new Frase(componentes[0], uint.Parse(componentes[1]), uint.Parse(componentes[2])));
                }
                rd.Close();
                lblNomeMusica.Text = nomeMusica;
                musica = engine.Play2D(caminhoMusica);
                timer1.Start();
                frasesParaExibir = getFrasesParaExibicao(frases, musica.PlayPosition);
                renderizarFrases(frasesParaExibir);
                musica.Volume = 1;
            }
        }
开发者ID:Punloeu,项目名称:karaoke,代码行数:34,代码来源:frmPrincipal.cs

示例2: Initialize

		public static void Initialize()
		{
			sounds = new Cache<string, ISoundSource>(LoadSound);
			music = null;
			currentMusic = null;
			video = null;
		}
开发者ID:JackKucan,项目名称:OpenRA,代码行数:7,代码来源:Sound.cs

示例3: Play

 public void Play(ISound Sound)
 {
     #if DEBUG_VERBOSE
         if (Debugger.IsAttached)
             Debug.WriteLine("Play(Sound) called from NullAudioService");
     #endif
 }
开发者ID:iLambda,项目名称:Freemwork,代码行数:7,代码来源:NullAudioService.cs

示例4:

		Result IFModSystem.PlaySound(ChannelIndex channelIndex, ISound sound, bool paused, ref IChannel channel)
		{
			CheckMemberOnlyCall();
			
			var result = NativeFModSystem.PlaySound(Self, channelIndex, sound, paused, ref channel);
			
			return result;
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:8,代码来源:InVisionNativeFMod.CppInstances.cs

示例5: Play

    public void Play(ISound sound)
    {
        lock (_lock)
        {
            sounds.Add(sound);
        }

    }
开发者ID:YJh2046,项目名称:BlockFun,代码行数:8,代码来源:DSPPlayer.cs

示例6: PlayFinished

 void ISoundStopEventReceiver.OnSoundStopped(ISound sound, StopEventCause reason, object userData)
 {
     _soundPlaying = null;
     if (PlayFinished != null)
     {
         PlayFinished(_audioClip);
         _audioClip = null;
     }
 }
开发者ID:smarinel,项目名称:ags-web,代码行数:9,代码来源:IrrklangPlayer.cs

示例7: Play

 public void Play(ISound Sound)
 {
     var sound = (XNASound)Sound;
     if (AllowedToPlay)
     {
         var inst = sound.Sound.CreateInstance();
         inst.Volume = sound.Volume;
         inst.Pitch = sound.Pitch;
         inst.Pan = sound.Pan;
         inst.Play();
     }
 }
开发者ID:iLambda,项目名称:Freemwork,代码行数:12,代码来源:XNAAudioService.cs

示例8: Sound2D

 public Sound2D(string soundName, bool looped, bool paused)
 {
     this.loop = looped;
     this.paused = paused;
     SoundEffect soundEffect = ResourceManager.Inst.GetSoundEffect(soundName);
     this.sound = SoundEngine.Device.Play2D(soundEffect.Sound, loop, paused, false);
 }
开发者ID:MattVitelli,项目名称:Nosferatu,代码行数:7,代码来源:Sound2D.cs

示例9: Demo

        public Demo()
        {
            this.graphics = new GraphicsDeviceManager(this);
            this.sound = new SoundBASS();

            Content.RootDirectory = "Content";
        }
开发者ID:scenex,项目名称:Demo,代码行数:7,代码来源:Demo.cs

示例10: EntityWalker

 public EntityWalker(string unique_name)
     : base(unique_name)
 {
     IsGhost = false;
     StepSounds = new List<string>();
     active_step_sound = null;
     step_sound_index = 0;
 }
开发者ID:bomzhkolyadun,项目名称:InvisibilityGame,代码行数:8,代码来源:EntityWalker.cs

示例11: Dispose

 public void Dispose()
 {
     if(m_Sound != null)
     {
         m_Sound.Dispose();
         m_Sound = null;
         m_Filename = null;
     }
 }
开发者ID:grofit,项目名称:Ambient,代码行数:9,代码来源:IrrKlangSoundPlayer.cs

示例12: PlayLooped

 public void PlayLooped()
 {
     if (_sound == null) _sound = AudioProvider.SoundEngine.Play2D(_source, true, false, false);
     else
     {
         _sound.Looped = true;
         _sound.Paused = false;
     }
 }
开发者ID:Zhenya21,项目名称:Checkers,代码行数:9,代码来源:Audio.cs

示例13: LoadFile

 public void LoadFile(string filePath)
 {
     if(internalSound != null)
     {
         internalSound.Stop();
         internalSound.Dispose();
     }
     internalSound = soundFactory.GetSoundForFile(filePath);
 }
开发者ID:grofit,项目名称:Ambient-v2,代码行数:9,代码来源:IrrklangMusicPlayer.cs

示例14: IntroScreen

        public IntroScreen(Game Game)
            : base(Game, GeneralManager.ScreenX, GeneralManager.ScreenY)
        {
            BSS = new BlackScreenSwitch();
            BSS.SwitchState = SceneSwitchEffect.State.SwitchOn;
            BSS.MaxTime = 1f;
            m = SoundEngine.PlaySound(Vector2.Zero,"Content/Sounds/Logos jingle.mp3");

            Renderer.AddPostProcess(BSS, "Switch");
        }
开发者ID:BartoszF,项目名称:ArtifactsRider,代码行数:10,代码来源:IntroScreen.cs

示例15: SoundManager

 SoundManager()
 {
     Sound = new SoundXACT()
     {
         SettingsFile = @"Content\Sound\ccm.xgs",
         EffectWaveBankFile = @"Content\Sound\SE Bank.xwb",
         StreamWaveBankFile = @"Content\Sound\BGM Bank.xwb",
         SoundBankFile = @"Content\Sound\Sound Bank.xsb",
     };
 }
开发者ID:himapo,项目名称:ccm,代码行数:10,代码来源:SoundManager.cs


注:本文中的ISound类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。