报警声总是标准的WP8

时间:2013-12-27 04:48:43

标签: windows-phone-8

我尝试使用自定义声音来呼叫闹钟,但声音总是标准的。我做错了什么?声音文件放在Solution根文件夹中。这是我的代码。 xml清单和引用中的更改是正确的,警报在正确的时间显示正确的内容,但声音是标准的......

Alarm alarm = ScheduledActionService.Find(alarmName) as Alarm;

if(alarm != null) {
   RemoveAgent(alarmName);
}

alarm = new Alarm(alarmName);
alarm.BeginTime = showTime;
alarm.RecurrenceType = RecurrenceInterval.None;
alarm.Content = message;

if(soundFile != "") {
   Debug.WriteLine("Alarm Sound set to " + soundFile);
   alarm.Sound = new Uri(soundFile,UriKind.Relative);
}

0 个答案:

没有答案
相关问题