Delay three seconds to play audio in PCMREAD_CALLBACK

Hi ,I am trying to play a real_time audio by PCRREAD_CALLBACK, it wroks well.
My problem is :
I populate sound data in the PCMREAD_CALLBACK ,but it delay about three seconds to play.
Can anyone help me ?
Thanks for reaction.

It is impossible to know without seeing the source code. You should be able to use the API examples as a guide, in particular the ‘user_created_sound’ example.