【发布时间】:2013-12-02 14:25:32
【问题描述】:
有人知道为什么这段代码不能让我的背景音乐不断循环吗??
正在加载内容:
backgroundMusic.Play(0.3f, 0.0f, 0.0f); //play background music (first float number is for volume)
更新中:
SoundEffectInstance instance = backgroundMusic.CreateInstance(); //creates instance for backgroundMusic
instance.IsLooped = true; //states that instance should loop meaning background music loops and never stops
提前致谢
编辑:我现在有了这个:
内容加载:
Song backgroundMusic = Content.Load<Song>("backgroundMusic");
然后分别:
public void PlayMusicRepeat(Song backgroundMusic)
{
MediaPlayer.Play(backgroundMusic);
MediaPlayer.IsRepeating = true;
}
【问题讨论】: