当前位置: 动力学知识库 > 问答 > 编程问答 >

Trying to play sound on blackberry playbook

问题描述:

I'm trying to play a simple beep sound in my playbook application when a countdown expires. I manage to get the countdown to work correctly and but I can't get my sound to work.

This is how i'm playing my sound.

[Embed(source="sounds/beep.mp3")] private var CustomSound:Class;

...

...

...

var sound : Sound = new CustomSound() as Sound;

sound.play();

网友答案:

If it is only a beep sound, you could do the following:

// play some sound
var fx:AudioEffectsManager = new AudioEffectsManager();
fx.play(AudioEffect.ALARM_BATTERY);

just replace the

AudioEffect.ALARM_BATTERY

by the sound of your choice.

分享给朋友:
您可能感兴趣的文章:
随机阅读: