PDM lib: Issue changing the sample rate PMD.Begin()

This is my second time posting so if I am breaking any norms, please call me out :slight_smile:

“Source code at the bottom of the post”

So I got the BLE up and running with the PDM lib, and send the output to the serial plotter.
I am sett up using 16 kHz, so I should receive 16k sample/s in serial plotter, but I am not doing that.
So I opened up putty, and send the output to a text file and let it run for 10s expecting roughly 160K samples, but only got around 60K

Then I tried lowering the sample rate, is I thought this could be related to not being able to send all the samples over serial, but no luck!
When I change the sample rate in PDM.begin(1,SAPLMERATE) it fails to initialize

The code below is from the examples → PDM
The code below works, but if i change the SAMPLERATE it fails. I tried with 4000 1000, and 8000
I just get serial output: Failed to start PDM!

  This example reads audio data from the on-board PDM microphones, and prints
  out the samples to the Serial console. The Serial Plotter built into the
  Arduino IDE can be used to plot the audio data (Tools -> Serial Plotter)

  - Arduino Nano 33 BLE board

  This example code is in the public domain.

#include <PDM.h>

// buffer to read samples into, each sample is 16-bits
short sampleBuffer[512];

// number of samples read
volatile int samplesRead;

void setup() {
  while (!Serial);

  // configure the data receive callback

  // optionally set the gain, defaults to 20
  // PDM.setGain(30);

  // initialize PDM with:
  // - one channel (mono mode)
  // - a 16 kHz sample rate
  if (!PDM.begin(1, 16000)) {
    Serial.println("Failed to start PDM!");
    while (1);

void loop() {
  // wait for samples to be read
  if (samplesRead) {

    // print samples to the serial monitor or plotter
    for (int i = 0; i < samplesRead; i++) {

    // clear the read count
    samplesRead = 0;

void onPDMdata() {
  // query the number of bytes available
  int bytesAvailable = PDM.available();

  // read into the sample buffer
  PDM.read(sampleBuffer, bytesAvailable);

  // 16-bit, 2 bytes per sample
  samplesRead = bytesAvailable / 2;

I found the source code to the lib: ArduinoCore-nRF528x-mbedos/PDM.cpp at master · arduino/ArduinoCore-nRF528x-mbedos · GitHub

switch (sampleRate) {
    case 16000:
    case 41667:
      return 0; // unsupported

Does it only support two sample rate: 16000 and 41667 ?
Is this clearly stated somewhere in the doc, I was unable to locate this info here: