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

Play audio snippet via nRF51/52

I am working on a device which also needs to give audio feedback to the user. The app on the mobile phone needs to send a wav (or similar) file (mono, speech) to the device and the device needs to play it through a small speaker.

Is this possible with the nRF51/52 and if so can you direct me in what is needed for it to get it working (DAC, amplifier, how to transfer the data, (external)buffer/memory needed, etc?)

Thanks in advance!

Parents
  • I believe it would be possible to play a basic sound on the nRF51 using PWM via the on-chip timers, but not while the soft device is running( I say this having successfully generated DTMF tones via PWM). I also believe I have read stuff recently relating to timeslots being available between SD operations, so I guess if your sound sample was very short, it might be possible.

Reply
  • I believe it would be possible to play a basic sound on the nRF51 using PWM via the on-chip timers, but not while the soft device is running( I say this having successfully generated DTMF tones via PWM). I also believe I have read stuff recently relating to timeslots being available between SD operations, so I guess if your sound sample was very short, it might be possible.

Children
  • So the main problem would be timing issues because the SOC is busy with BT handling? In my case I first wanted to get the wav data from the mobile phone onto the device and then play it. But now I am looking into putting all wav files I need on an SD card and then just get a trigger message over BT to play a certain file. Let's say the wav file is 1 minute long, would this be a problem? Or can this run in a separate process so I can still connect to the device via BLE to control it? (I am talking about SPI interface now not PWM).

  • I am not able to answer that in any competent way, except to say that I think you will stand more of a chance if you move up to the nRF52 with its improved performance and DMA capabilities.

    I minute of wave file is a lot of data, even if only 8 bits and 8kHz, which is barely "telephone" quality.

  • Having taken a quick look at the nRF52 datasheet, I think it would be perfectly viable to do this using the PWM in conjunction with the DMA. In fact, Nordic were demonstrating some drum noises at the nRF51 on tour event last week. If you need any help with this, I'd be happy to look into it, but I don't know what the guidelines are re. soliciting for work on these forums.

Related