Thank you very much for your help AlexT_Intel,
I have checked the code you pointed out and 1ms is completely useless for this application. I guess that the only alternative to use audio is by writing an ALSA driver for linux. That will require more work than what I'm willing to spend on this project, so I'll have to skip using the Galileo board until there's an easier way of doing this.