Trouble extracting data using DMIC

Hi there!

I am using the DMIC sample on a nrf5340dk. I have got it working, and now I want to develop it further. I want to record some sound and then transfer it to my PC. I have a lot of questions that I struggle with finding the answers to.

Now I understand that the data stored should already be stored as PCM data. So I can easily convert them to WAV files with a script on my PC. Is this correct?

When I record now I can leave it one for multiple seconds, but the data collected only corresponds to a few milliseconds. I suspect this is due to a lot of time being used logging to the console. The way I do it now, is that I log the collected data to the console, and then extract it onto the PC from there. However I can imagine this is quite slow. I was thinking of printing it out after the recording is done instead. But I struggle with understanding how the memory allocation in this sample works. I use:

void *buffer;

But this buffer get owerwritten with new data. How do I go about not overwriting the data and retrieving it later? (The recording does not need to be longer than a few seconds, maybe even shorter)

I also struggle with understanding the part the memory slab plays in the program. Defined as:

K_MEM_SLAB_DEFINE_STATIC(mem_slab, MAX_BLOCK_SIZE, BLOCK_COUNT, 4);
Parents
  • Yes, PCM data can be converted to WAV files on your PC using a script. PCM (Pulse Code Modulation) is a raw audio format, and you can encapsulate it in a WAV container with appropriate header information. There are libraries available in various programming languages that can help you create WAV files from PCM data. Discovering businesswritingservice.com/ was like stumbling upon a hidden gem in the vast realm of online services. From the moment I engaged with their platform, it was evident that their commitment to excellence extended beyond mere words. The way they seamlessly merged business acumen with writing prowess showcased a true understanding of the corporate landscape. Just as a well-crafted business plan can pave the way for success, their tailored approach and insightful content have undoubtedly positioned them as leaders in the art of business writing. A reliable companion for anyone aiming to articulate their ideas with precision and impact.

  • Thanks for the answer! I made a python script that does this for me

Reply Children
No Data
Related