Connecting Bluetooth Headphones (AirPods + Macbook)


I have tried numerous times to connect my AirPods Pro (and also my Bose QC 35 ii) to SC but I can’t seem to get them working. Has someone tried or managed to do it?

  • When I boot my server, the AirPods appear in the devices list, but I get the following error:
Requested sample rate 48000.000000 was not available - attempting to use sample rate of 44100.000000
set kAudioDevicePropertyNominalSampleRate error epon
could not initialize audio.
Server 'localhost' exited with exit code 0.
  • I have located them in the Audio Midi Setup.

  • Then I can select them as output device (48,0 kHz), and then Built in microphone as input device (also 48,0 kHz).

  • I have also tried changing the sample rate in SC s.options.sampleRate = 48000;

The only thing that “works” is to select the AirPods as input and output device but at the horrible quality of 8000 Hz.

Is this normal? Am I not seeing something? :thinking::pensive:

Thanks a lot in advance!

Your input and output have to have the same sample rate. The airpods are basically set to an output of 48K and an input of 16K, so you can use both at the same time. So you need to change the input (the computer mic maybe?) to 48K and use that as the input.

Make sense?


@Sam_Pluta you just made my day… It worked setting the built in mic to audio input + 48K. I thought I had tried this before, but apparently not so… thanks a lot!! :weight_lifting_man:t2:

Hi! I’m also having trouble with Bluetooth on a Mac and I don’t see many post regarding BT.

I don’t need any input so I did set o.numInputBusChannels = 0;. This makes it run at least, but the sound is one (or a few) octaves lower than expected.

Do you have any tips on how to set the sample rate or something else to make audio play normally via an external Bluetooth speaker? ps. MacOS is not my usual OS.

Thank you! :slight_smile:

I had a similar issue, so I found this post.

The only thing I would add to @Sam_Pluta’s reply (which might help @hamoid or others later) is that it sometimes might not be enough to change the sample rate of the internal mic to 48K in the Audio MIDI Setup app.

I added these two lines to my code (before starting up the server) and now I can use the AirPods without an issue:

Server.default.options.inDevice_("Built-in Microph");
s.options.numInputBusChannels= 0;

Try making an Aggregate device in Audio Midi Setup and adding your BT device at the output and your built-in Microphone as the output. Then select the Aggregate device for both the in and out devices in SC

An Aggregate device did help me. I had to set the same sample rate for both in and out.