Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

New Contributor
Posts: 7
Registered: ‎10-03-2012
My Device: 9810
My Carrier: Bell

Sound doesn't play

Here is my follwing code:

playAudio: function(src) {

var fn = "audio/" + src;
try {
var playerInstance = new blackberry.audio.Player(fn, "audio/m4a", true);
} catch(err) {
txt="Error playing audio\n\n" + fn + "\n\n";
txt+="Error: " + err.message + "\n\n";
txt+="Click OK to continue.\n\n";

I have an "audio" file with the file "Confidence.m4a" in it, which is in the root file.

In another function, I have




But I get an error: undefined when I try to call the method.


I've added 


<feature id="blackberry.audio" version=""/>
<feature id="blackberry.audio.Player" version=""/>


to my config.xml file.


What is the problem here?