void InfiniteLoopTask(void *pvParameters) { // GPIO Configuration GPIO_IF_LedConfigure(LED1|LED3); GPIO_IF_LedOff(MCU_RED_LED_GPIO); TimerConfigNStart(); while(1); }
//this function accepts a pointer to a buffer //and the number of seconds of recording is desired //and fills the buffer with microphone data //it returns the number of bytes of data stored in the buffer. //The current system is set up to record 10000 samples per second. //this corresponds to 20000 bytes per second // some common values of numSeconds // milSec = 1000 -> 20000 bytes uint32_t GetAudio(char * buf, int milSec){ uint32_t numSamples = milSec * (SAMPLE_RATE / 1000); TimerConfigNStart(numSamples, buf); //TimerConfigNStart(1000, buf); while(!RecordingDone){ } TimerDeinitStop(); return MIC_SAMPLE_SIZE*CurrentSamples; }