DEV Community

Shahir Islam
Shahir Islam

Posted on

I built PhoneEar

Watch the intro video

Ever wanted to watch something on your Mac but hear it in your phone's headphones?

It was late, I was watching a show on my MacBook, and my headphones were plugged into my iPhone. The Mac speakers would have woken everyone up.

So I built PhoneEar 🎧

▢️ Run it on your Mac
πŸ“± Scan the QR code with your iPhone
πŸ‘† Tap "listen"

That's it. Your Mac's sound now plays through your iPhone, in whatever headphones are plugged in or paired.

βœ… No iPhone app. It runs in Safari
βœ… Mac speakers mute automatically
βœ… Works over your home Wi-Fi
βœ… Free and open source (MIT)
βœ… The whole thing is one Swift file

The most fun bug along the way: the audio sounded about 9% too fast and kept stuttering. It turned out macOS reported the audio as 48,000 Hz, but the MacBook speakers actually run at 44,100 Hz. One les sounded right again. πŸ™‚

It's open source, so try it, fork it, or tell me what to t comment πŸ‘‡

Github Link : https://github.com/shahirislam/phoneear

OpenSource #Swift #macOS #iPhone #BuildInPublic #SidePro

Top comments (0)