Languages

Menu
Sites
Language
Looped sound

Hi

 

I need my sound to be played countinuosly. I set looping for Player and it works but after end playing and before start

to play again there is about half second pause. In my game I  have a sound like working engine and it must sounds non-stop

without any breaks.

 

Did you notice such effect in your game? Is any way to remove this break for looping sound?

 

My code sinppet:

...

pPlayer->SetVolume(volume);
pPlayer->SetLooping(true);

r = pPlayer->Play();

...

Regards,

Slaw

 

 

 

 

Responses

3 Replies
Chintan Gandhi

Hi Slawek Kowalski,

Look at this its cool.

You are using pPlayer->Play(); right? Now to recursively play your music with no gap in between  just add the same line to call back method of IPlayerEventListener class OnPlayerEndOfClip (void).

I am attaching the snippet from my app. Have a look

result
canvasForm::OnDraw(void)
{

__player->Play();

}

void
canvasForm::OnPlayerEndOfClip (void)
{
__player->Play();
}

void
canvasForm::OnPlayerErrorOccurred (Tizen::Media::PlayerErrorReason r)
{

}

void
canvasForm::OnPlayerInterrupted (void)
{

}

void
canvasForm::OnPlayerOpened (result r)
{

}

void
canvasForm::OnPlayerReleased (void)
{

}

 

Note the use of player->Play() in OnPlayerEndofClip();

Thanks.

 

Slawek Kowalski

Thank you for your help. I used AudioListener and callback OnPlayerEndOfClip() as you said and it doesn't help. There is still gap between playbacks.

 

I think there is some issue in API. Android allows to play a looped sample without any gaps.

 

 


 

Chintan Gandhi

Did you mean IAudioOutEventListener?

AFAIK to play an audio file with no gap between successive playbacks you should use IPlayerEventListener. And also OnPlayerEndofClip() will only work with this and not with Audio Listeners.