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: 6
Registered: ‎03-28-2013
My Device: BBZ10
My Carrier: Airtel

Playing 2 Audio files without timegap

Hi All,

 

I need to play 2 sound files continuously without timegap one after the other looping.

I created 

 

connection = mmr_connect(NULL);

 

ctxt = mmr_context_create(connection, ctxt_name, 0, mode);

 

looking into the playaudio sample.

 

I was able to play a single sound without any issues.

 

But when i try to play the second sound after the first sound ends, the real problem arises.

Here is the code what i tried

 

for (; Smiley Wink {

 

// now, get the actual event

const mmr_event_t* event;

event = mmr_event_get(ctxt);

errorWait = mmr_event_wait(ctxt);

if (errorWait != 0) {

 

//TODO: Error handling

}

switch (event->state) {

case 0: {

printf(

" -----------------------------Event MMR_STATE_DESTROYED \n");

 

break;

}

case 1: {

printf(

" -----------------------------Event MMR_STATE_IDLE \n");

 

break;

}

case 2: {

 

mmr_input_attach(ctxt, secondAudioURL, input_type);

mmr_play(ctxt);

printf(

" -----------------------------Event MMR_STATE_STOPPED \n");

break;

}

case 3: {

printf(

" -----------------------------Event MMR_STATE_PLAYING \n");

break;

}

}//switch

} //for

 

Instead of playing the second sound, the state keeps on changing. Am unable to move forward.

 

Please help me out.

Or is there any way to play 2 files in a loop. I tried playlist also. But that too failed.

 

 

thanks