I have looked almost everywhere trying to find a way to save my android tts output in an audio file. I looked at these posts:
It might not be that it doesn't work on real devices. The problem could be that you are testing a real device with the USB cable plugged into the computer in debug mode. This might be disabling saving files to the phone.
Environment.getExternalStorageDirectory()
Return the primary external storage directory. This directory may not currently be accessible if it has been mounted by the user on their computer, has been removed from the device, or some other problem has happened. You can determine its current state with getExternalStorageState().