tags:

views:

45

answers:

0

Hi!

I was using audiotrack to play some sounds in a loop. Now I need to know in which period of time I'm right now, so i decided to use setPositionNotificationPeriod which works quite good. The problem is that it just work for the first "loop" but stop being called after that :\

The code looks like the following:

...
audioTrack.setPositionNotificationPeriod(bufferSize/numCalls);
audioTrack.setPlaybackPositionUpdateListener(this); 
audioTrack.setLoopPoints(0,bufferSize,-1);
...

public void onPeriodicNotification(AudioTrack track) 
{
    Log.d("Hey I'm on call: "+numCall++);
}

With that I got just #numCalls# calls but I want them to be forever.

Any idea how to fix it?

Thank you very much

EDIT: I forgot to say I'm using an static audiotrack instead of stream