I am using an adafruit-nrf52-pro-feather (nrf52832) to run my project of detecting voice by this below scenario:
++ Setting up:
[PC] ==== USB cable =====[Adafruit] * * * BLE * * * [Phone]
+ Audio files are very small size (less than 100kB or 20 seconds), with ADPCM format
+ USB cable which is delivered together with the board, but currently I am using as UART port for monitoring serial log.
I still have some concerns for this scenario as:
1) For transferring audio files from PC to the Adafruit, what are the available approaches ?
Is there any way to use the same USB cable and still have UART port debugging normally?
2) I suppose the received audio files would stay in RAM by default, but is Ada RAM enough for the above size?
3) Can I send the file (in RAM) directly via BLE or I need to do somethings else before sending via BLE?
I appreciate any suggestions/helps or some reference links.
Thanks Einar Thorsrud for commenting.
I want to transfer the audio file at one time, as I think it's not big. May be I will split it up by chunks as you said if there is no way to compress it smaller.
From the SDK 14.1 I can't search out some examples to proceed with tranferring a very small file to test it.
You may of course be able to compress it, but that depend on your project. As you have a PC in one end then I assume it is easier to compress on that side, and do the decompression on the phone? You can compress audio on the nRF as well, but it may not be as efficient due to the relatively slow CPU (at least if you want to compress the audio real time). If you want to do audio compression on the nRF side, then you could for example consider the Opus codec.
The input requirement for my phone's apps is ADPCM format. Yes you are right, I will make the compress on the PC could do it faster and easier than the nRF.
Now I need some information about duplexing both UART applications as your suggestion. In worst case I would think about putting the file into SD card and read from there.
I see. I do not have any more specific suggestions about UART duplexing, but I think both alternatives should be fairly simple to implement on both sides. You probably want to avoid the logger module in the SDK though, and handle the UART communication yourself, using only the UART driver.