本文整理汇总了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;
}
}
示例2: Initialize
public static void Initialize()
{
sounds = new Cache<string, ISoundSource>(LoadSound);
music = null;
currentMusic = null;
video = null;
}
示例3: Play
public void Play(ISound Sound)
{
#if DEBUG_VERBOSE
if (Debugger.IsAttached)
Debug.WriteLine("Play(Sound) called from NullAudioService");
#endif
}
示例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;
}
示例5: Play
public void Play(ISound sound)
{
lock (_lock)
{
sounds.Add(sound);
}
}
示例6: PlayFinished
void ISoundStopEventReceiver.OnSoundStopped(ISound sound, StopEventCause reason, object userData)
{
_soundPlaying = null;
if (PlayFinished != null)
{
PlayFinished(_audioClip);
_audioClip = null;
}
}
示例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();
}
}
示例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);
}
示例9: Demo
public Demo()
{
this.graphics = new GraphicsDeviceManager(this);
this.sound = new SoundBASS();
Content.RootDirectory = "Content";
}
示例10: EntityWalker
public EntityWalker(string unique_name)
: base(unique_name)
{
IsGhost = false;
StepSounds = new List<string>();
active_step_sound = null;
step_sound_index = 0;
}
示例11: Dispose
public void Dispose()
{
if(m_Sound != null)
{
m_Sound.Dispose();
m_Sound = null;
m_Filename = null;
}
}
示例12: PlayLooped
public void PlayLooped()
{
if (_sound == null) _sound = AudioProvider.SoundEngine.Play2D(_source, true, false, false);
else
{
_sound.Looped = true;
_sound.Paused = false;
}
}
示例13: LoadFile
public void LoadFile(string filePath)
{
if(internalSound != null)
{
internalSound.Stop();
internalSound.Dispose();
}
internalSound = soundFactory.GetSoundForFile(filePath);
}
示例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");
}
示例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",
};
}