Hi Michael, I was thinking about playing back tones where a smooth, continuous playback is quite important. I'm still curious with bzero()-ing approach, which should be simpler to implement. It would only require one callback to be called, and it will be called everytime EOF condition is reached. If application decides to continue playback (in the loop case), then buffer will be re-filled as usual. If not, we will bzero() the remainder of the frame before returning this last frame to get_frame() caller. This should fix the "blip" problem of the last frame, IMO. -benny Michael Broughton wrote: > Hi Benny > > I suppose it would depend on what you are playing. My voice recordings > sound just fine looping in this manner. But I do get your point. > > I think the only way to satisfy everyone would be to add a second > callback function, or add another argument to the current callback > function and just call it at two points: > > 1. At EOF, even if playback is not done. > 2. If not looping, when playback is complete (all frames have been sent out) > > I'll try to whip up a new patch as soon as possible. > > Mike > > > Benny Prijono wrote: >> Thanks for the patch, Mike. >> >> There is a problem though (or so I think). With the patch, the >> default behavior has changed to loop the playback instead of playing >> it once, which is fine, as I don't think people will object that >> much and this is consistent with the WAV player default behavior. >> >> But with the new callback approach, the player won't be able to >> smoothly play the buffer in a loop, as everytime end-of-buffer >> condition is reached, the player will insert silence at the end of a >> frame. In other words, to smoothly playback a buffer in a loop, one >> has to make the buffer size equal to multiple frame size, which is >> difficult IMO. >> >> Thinking about the original problem, I'm wondering if simply >> bzero-ing the remaining frame after EOF is reached will solve the >> problem (I think so!). >> >> cheers, >> -benny >> >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip at lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> > > -- Benny Prijono http://www.pjsip.org