This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[NRF5][adafruit-nrf52-pro-feather] Transfer audio files from PC to Adafruit board, then sending via BLE

Dear all,

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

http://www.kowatec.com/prod/ap/products.php?a=adpcm 

+ 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.

Best Regards,

James, Dinh

Parents
  • Hi James,

    1. I do not have any experience with the Adafruit Feather nRF52 Pro, but it seems like it has some form of USB<->UART bridge. The nRF52 only have a single UART peripheral, so if you want to both use logging and transfer audio over UART simultaneously, then you need some application specific "protocol" on top of the UART to separate the two data streams. Perhaps a simple TLV format (with only two types: log or audio). Alternatively, you could simply separate on direction, so that that all data to the nRF52 is audio data and all data from the nRF52 is log.
    2. It is difficult to say how much RAM you need for your application without knowing more about it, but the nRF52832 on the Adafruit Feather nRF52 Pro has a total of 64 kB RAM, so it is clearly not possible to fit a 100k B audio file. Do you need to transfer the file in one go, or can you split it up in chunks?
    3. I guess this is application specific. Please note that audio over BLE is not yet standardized, so you will typically need a custom app on the phone side.
  • Thanks 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. 

  • Hi,

    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.

Reply Children
Related