Welcome!

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

Native Development

Reply
New Contributor
Posts: 7
Registered: ‎06-14-2013
My Device: z10 Dev
My Carrier: Bell

asset:///music/alg.wav" is not a supported asset file.

Hey All,

 

I am currently working on getting the music player working within my QML and have been following the example from the cascades references:

 

https://developer.blackberry.com/cascades/reference/bb__multimedia__mediaplayer.html

 

I have knocked out the video stuff as I am not playing video and done require that, so my music player attachedObject is this:

 

MediaPlayer {
     id: player
     sourceUrl: "asset:///music/alg.wav"

 

     onMediaStateChanged: {
            switch (player.mediaState) {
                   case MediaState.Unprepared:
                            break;
                   case MediaState.Prepared:
                            break;
                   // ...
           }
     }
}

 

I have tried putting a mp3, wma and wav file in for the sourceUrl and have received the same error each time:

 

       asset:///music/alg.wav" is not a supported asset file.

 

The file is being stored in my assets folder in a music folder.  I have also tried this just in the assets folder with no change.

 

The secondary issue with this is I don't know if this will even play music through the simulator to test if it's working/or not.  I intent to test this tonight with a friend who has a z10, but would like to know if there is an underlying issue that is just not working that isn't the simulator.

 

Thanks in advance,

 

Andrew

Developer
Posts: 84
Registered: ‎12-01-2012
My Device: 9790
My Carrier: Orange

Re: asset:///music/alg.wav" is not a supported asset file.

Try: 
sourceUrl: "asset:////sounds////alg.wav"

 

It was working for me.

Lublin BlackBerry Developer Group


---
If I helped you please mark my response as solution or "Like" it.
Developer
Posts: 1,008
Registered: ‎12-12-2010
My Device: Passport (Red Limited Edition)
My Carrier: Mobile Vikings

Re: asset:///music/alg.wav" is not a supported asset file.

I get the same error on my data.xml (used in my XmlDataSource), but it works fine nonetheless. Maybe you can just ignore this warning?

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Developer
Posts: 84
Registered: ‎12-01-2012
My Device: 9790
My Carrier: Orange

Re: asset:///music/alg.wav" is not a supported asset file.

Maybe it is something with your wav file. I would try a mp3 file or another wav with single channel etc.

Lublin BlackBerry Developer Group


---
If I helped you please mark my response as solution or "Like" it.