Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to use Sonos as wireless speakers for a Mac...

Here's a solution I just tried, and found that actually works! I've listed it as an *idea* because I would assume that SONOS might be able to offer a similar solution, unless (of course) licensing issues prevent them from doing it without permission from Apple. (Don't know... just speculating here).


This software solution provides an "airplay" driver on your mac that points to one of your Sonos players. Once it's installed, you use it with three simple steps.


Step 1) Open a terminal prompt (command prompt) and type airsonos. This starts the driver.

Don't close the session. It's OK to minimize the window.


Step 2) You use the Mac's "System Preferences..." , "Sound" to select the sonos as the output for your sound. Now, play some music on your mac, and turn up the volume, and the sound comes out of your Sonos" instead of your Mac. No wires. No hassle.


Step 3) Grin from ear to ear as any and all Mac sound streams wirelessly to your Sonos!



HERE'S HOW TO INSTALL THE DRIVERS,

PLUS LINKS TO WHERE I FOUND THE SOLUTION.

(I can't take credit for creating it, but I'm so happy to have found it... thank you Stephen! ... that I'm willing to share it far and wide!)


airsonos a Node.js application, and it's free!

You need to install the right version of Node.js (it's an older version),

and then you need to use npm (the Node package manager) which will download, compile and i

install airsonos. It's all pretty easy. You don't need more than basic computer skills to get it done.

-----------------------------

I found info here:

https://medium.com/@stephencwan/hacking-airplay-into-sonos-93a41a1fcfbb


and installation instructions here:

https://github.com/stephen/airsonos


IMPORTANT NOTE: It states it requires Node.js version v0.10.33 or greater.

I tried it with the current release of Node.js (v0.12.xx) and it wouldn't compile.

When I downloaded and installed Node.js version v0.10.33, and then tried to install it everything worked!


Here are the brief instructions:


Step 1)

Download Node.js v0.10.33 from here:

http://blog.nodejs.org/2014/10/23/node-v0-10-33-stable/


or use google to find it.


Step 2) Run the install (node-v0.10.33.pkg) to install Node.js


Step 3) Open a terminal prompt, and at the command line type:

sudo npm install airsonos -g


This will cause the npm (the node package manager) to download, compile and install airsonos and the packages it requires. It took about 5 or 10 minutes to complete.


Now it's installed!


To use it, it's two simple steps:


*** First) open a terminal and at the command prompt type:

airsonos

./

You should see output similar to:


MacBook-Pro:~user$ airsonos

Searching for Sonos devices on network...

Setting up AirSonos for Basement {192.168.0.10:1400}


Setting up AirSonos for Office {192.168.0.20:1400}


On my machine these messages were repeated several times.

LEAVE THE TERMINAL WINDOW. Don't close it, or kill the airsonos app.

It *IS* OK to minimize the window.


*** Second)

Go to system preferences... (under the apple menu), select "Sound" and for "Output" create one of the airsonos outputs. For instance, in my situation I selected .

"Office (AirSonos) AirPlay".


Now play some music on your mac, turn up the volume on your mac, and listen the music come out through Sonos!


This is awesome. You can now send steaming services to Sonos, you can output your itunes music to sonos. Want to hear a playlist of songs from youtube... done, amazon music prime... it now works!, etc, etc.


Many, many thanks to Stephen for creating this and sharing the info.


I didn't create any of this, I'm just sharing the information since I've wanted this feature for so long, I'm happy to finally find a quality solution that works!


-Phil

Posted on Feb 28, 2015 8:48 AM

Reply
Question marked as Best reply

Posted on Feb 13, 2017 8:06 AM

Hi,


Thanks for pulling this all together! The one other step I needed to do to make this work was to download Xcode (its a huge 2gb file) from the app store and install it before step 3. Reallly happy to be using my Play:1 as a speaker instead of the built in monitor speakers.

64 replies

Jan 6, 2017 11:32 AM in response to StefanTotev

I am very computer illiterate, so I'm not the best person to ask. I ended up having to run the download 2x before I got it to work, when i type airsonos in on the TERMINAL it wouldn't find it. So I copied and pasted the sudo np install -g thing suggested in the comments and entered my password then it went crazy running stuff. I got scared thinking I was probably getting my computer hacked or it would crashed but after a couple of minutes terminal shows searching for Sonos devices on network... then it found Family Room with the IP address and said Search complete.


I left that open and went to SYSTEM PREFERENCES on Output it shows Family Room (Air Sonos) so I selected it. Opened iTunes and there is a little target circle thing with an arrow to the right of the volume control - mine wasn't gray I just selected it & it worked. I hope you get yours to work. Sorry I'm not more helpful.

Feb 2, 2017 9:53 PM in response to pjbrownva

Thanks for sharing this option, but up to now I always get this error after trying to connect to sonos:

Error: Invalid key length

at Error (native)

at new Decipheriv (crypto.js:239:16)

at Object.Decipheriv (crypto.js:236:12)

at Object.decryptAudioData (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js:141: 25)

at RtpServer.<anonymous> (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtp.js:32:23)

at emitTwo (events.js:106:13)

at Socket.emit (events.js:191:7)

at UDP.onMessage (dgram.js:550:8)


any ideas to fix it?

Feb 13, 2017 8:05 AM in response to mastermilo

Here's a reply (better late than never!),


The speakers will AWAYS lag behind your computer. This solution is really for using sonos speakers INSTEAD of your computer speakers, not using both together.


However, if you have multiple sonos speakers and/or a multi-room sonos setup, you should be able to use the SONOS features to play the music on as many sonos speakers as you like, and the music should be synchronized between the different sonos devices. That's a feature that sonos supports... it's a sonos feature to synchronize the music.

Apr 15, 2017 6:44 PM in response to VinKiesl

I have the same problem... Seems to work fine until any audio goes through and crashes.

Error: Invalid key length

at Error (native)

at new Decipheriv (crypto.js:239:16)

at Object.Decipheriv (crypto.js:236:12)

at Object.decryptAudioData (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js:141: 25)

at RtpServer.<anonymous> (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtp.js:32:23)

at emitTwo (events.js:106:13)

at Socket.emit (events.js:191:7)

at UDP.onMessage (dgram.js:549:8)

Jul 19, 2017 1:24 PM in response to tmckz

This is entirely Airplay's disadvantage. Maybe Airplay 2 will fix this in the Autumn.

I've went down the expensive way and bought a Play:5 (which has an AUX port) and use it connected with the Airplay Express (which has the option of Airplay-ing audio). This is a rather complex and expensive solution, but it's the only one until Sonos decides to add Airplay functionality (which may never happen). I think to try Apple's Homepod once it comes out. It really could replace my Sonos setup (apart from the soundbar).

Aug 2, 2017 2:31 PM in response to pjbrownva

Great that people are here to help!

I almost got it working, but when i select sonos in my system preferences it disappears after a few seconds and terminal says the underneath, any tips or tricks to solve this? Thanks!


machd:~ jochemsanders$ airsonos

Searching for Sonos devices on network...


Living Room (@ 192.168.2.2:1400, RINCON_949F3E89E7EC01400:2152209071)


Search complete. Set up 1 device tunnel.

crypto.js:242

this._handle.initiv(cipher, toBuf(key), toBuf(iv));

^


Error: Invalid key length

at Error (native)

at new Decipheriv (crypto.js:242:16)

at Object.Decipheriv (crypto.js:239:12)

at Object.decryptAudioData (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js:141: 25)

at RtpServer.<anonymous> (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtp.js:32:23)

at emitTwo (events.js:106:13)

at Socket.emit (events.js:191:7)

at UDP.onMessage (dgram.js:548:8)

machd:~ jochemsanders$

Oct 30, 2017 11:57 AM in response to jochemsanders

Hi,


Great post and good work. However I followed the guide but it fails for me. My Sonos Spaker appears in both the Sound panel and also in the Airplay options in iTunes but when I select either of those options to play sound the Node server crashes as below:-


Searching for Sonos devices on network...



My Sonos (@ XXX.XXX.XXX.XXX:1400, RINCON_B8E93733491601400:2853667111)



Search complete. Set up 1 device tunnel.

crypto.js:267

this._handle.initiv(cipher, toBuf(key), toBuf(iv));

^

Error: Invalid key length

at new Decipheriv (crypto.js:267:16)

at Object.Decipheriv (crypto.js:264:12)

at Object.decryptAudioData (/Volumes/Sandbox/airsonos/node_modules/nodetunes/lib/helper.js:141:25)

at RtpServer.<anonymous> (/Volumes/Sandbox/airsonos/node_modules/nodetunes/lib/rtp.js:32:23)

at emitTwo (events.js:125:13)

at Socket.emit (events.js:213:7)

at UDP.onMessage [as onmessage] (dgram.js:659:8)


Mac OSX Sierra 10.12.6 and Node version 5.4.2


Any ideas ? I used npm install -g --unsafe-perm airsonos to install it.

Jan 25, 2018 3:11 AM in response to pjbrownva

/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/node_modules/np m-package-arg/npa.js:6

let url

^^^

SyntaxError: Unexpected strict mode reserved word

at Module._compile (module.js:439:25)

at Object.Module._extensions..js (module.js:474:10)

at Module.load (module.js:356:32)

at Function.Module._load (module.js:312:12)

at Module.require (module.js:364:17)

at require (module.js:380:17)

at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/access.js :5:11)

at Module._compile (module.js:456:26)

at Object.Module._extensions..js (module.js:474:10)

at Module.load (module.js:356:32)



hello good evening, I'm not really clever with computers. can you help me on this, please? I installed a 9.4 version and later the 10.33 version. I don't know why is showing me this error

How to use Sonos as wireless speakers for a Mac...

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.