Sounds like maybe you are not making the RAW file to the right specifications:
* Raw PCM (no header)
* 8000 samples per second
* 8 bits per sample
* uLaw compression
* Maximum ring size 16080 samples
* Minimum ring size 240 samples
* Number of samples in the ring must be evenly divisible by 240
* Ring should start and end at the zero crossing
(Make sure your sampling, bits and compression are correct!)