Use USB Audio 2.0 Record by Frame
Posted: Mon Mar 20, 2017 5:10 am
Hi,All
According the Microphone array library V2.0.0 manual,if i set MIC_ARRAY_MAX_FRAME_SIZE_LOG2 = 9 buffering_type = DECIMATOR_HALF_FRAME_OVERLAP in decimator_config_common.
Now I got 512 samples by Frame, but i don't know how to sent it to USB,there is not demo code in website.
code:
while(1)
{
mic_array_frame_time_domain * unsafe current = mic_array_get_next_time_domain_frame(c_ds_output, 1/*2*/, buffer, mic_audio, dc);
unsafe
{
int req;
user_pdm_process(current, output);
c_audio :> req;
if(req)
{
for(int i = 0; i < NUM_PDM_MICS; i++)
{
c_audio <: (int)output;
}
}
else
{
break;
}
}
}
}
According the Microphone array library V2.0.0 manual,if i set MIC_ARRAY_MAX_FRAME_SIZE_LOG2 = 9 buffering_type = DECIMATOR_HALF_FRAME_OVERLAP in decimator_config_common.
Now I got 512 samples by Frame, but i don't know how to sent it to USB,there is not demo code in website.
code:
while(1)
{
mic_array_frame_time_domain * unsafe current = mic_array_get_next_time_domain_frame(c_ds_output, 1/*2*/, buffer, mic_audio, dc);
unsafe
{
int req;
user_pdm_process(current, output);
c_audio :> req;
if(req)
{
for(int i = 0; i < NUM_PDM_MICS; i++)
{
c_audio <: (int)output;
}
}
else
{
break;
}
}
}
}