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
Contributor
flynnman
Posts: 18
Registered: ‎01-23-2011
My Device: Not Specified
Accepted Solution

Can not get mmr_play etc to work

I am trying to get the mmr audio library to play some mp3 files

but it keeps crashing 

 

The code is indentical to the sample on

https://developer.blackberry.com/native/documentation/recipe_play_audio_1935324_11.html

(and elsewhere in the documentation)

 

initially if I call

mmr_output_parameters(m_ctxt, audio_oid, NULL);

it crashes in strm_dict_key_get()

 

If I comment out that line it crashes in mmr_play() (sigsegv)

 

I am calling bps_initalize() elsewhere 

 

I have enabled sound in the bar-descriptor.xml

 

Is there anything else that needs to be initialized?  Has anybody else gotten this to work?

 

Kind of related is it possible / supported to play multiple sounds at the same time using mmr?

The documentation is not clear on this.

 

I am attempting to use mmr and not OpenAL since I want to play MP3 but see the related psot I am about to make

Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: Can not get mmr_play etc to work

Hi there,

 

I see you've posted this some time ago; have you made any progress on this front?

Let mew know and I will try to reprocude the issue;

 

Thanks!

 

Martin

 

Please use plain text.
Contributor
flynnman
Posts: 18
Registered: ‎01-23-2011
My Device: Not Specified

Re: Can not get mmr_play etc to work

Thanks for the response I did post an update but i must have made it to the wrong post.

(see my related post)

 

It turns out the reason it was crashing was a stupid error on my part

once I fixed that it stopped crashing

 

After plenty of trial and error I got it to work.

I am also able to play multiple mp3 files at any given time.

 

I think I will use a hybrid model though, .wav files for the sound effects and .mp3 files for the backing track.  I am finding the mp3 files do not seem to be as spunky was the wav file and they just seem off timing wise sometimes.

 

I am also a little surpised that mmr_stop() is so expensive, it caused glitches in my game, but I moved it to a different thread and all seems fine.

Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: Can not get mmr_play etc to work

I'm glad you got it to work.

 

Using separate threads for such operations is a good idea. If you run into additional problems or find solutions from which others could benefit post away!

 

Cheers,

 

Martin

 

 

 

Please use plain text.
New Contributor
thadude3
Posts: 8
Registered: ‎01-13-2011
My Device: Not Specified

Re: Can not get mmr_play etc to work

where is the related post? or better yet what was the error? I am seeing this also and it just started happening. used to work fine.

Please use plain text.