32

Is it possible to send audio from music in iTunes, or from movies on Netflix, or video game sounds, etc., from my MacBook and receive and listen to the audio on my iPhone? I'm thinking of this working like wireless headphones, except with a really long cord. If there is a way could you let me know how the solution works, I'm interested in creating my own script/app to do this if it's not too daunting.

If its important, I'm running an old 2009 MacBook, running Snow Leopard.

4
  • 2
    Crikey what year are you living in if a 20009 is old? That's 18,000 years in the future! ;) Dec 27, 2011 at 9:15
  • 1
    I'm glad you were able to make that comment before I edited it, @GraemeHutchison :). Dec 27, 2011 at 12:26
  • Has there been anything new since 2011?
    – Adam_G
    Apr 16, 2019 at 18:25
  • This is super dumb, but play the thing you want on both devices at the same time and just listen... Hopefully the iPhone app you're using to listen to can be backgrounded...
    – Honey
    Oct 30, 2020 at 20:42

5 Answers 5

12

Here is a little solution that uses the open source programs Soundflower, VLC and SoX.

First of all, you need to install the necessary programs using Homebrew:

brew install sox
brew install --cask soundflower vlc

Choose the Soundflower (2ch) device in the system settings for the sound output such that it can be forwarded to a VLC server which we will set up next. (Note, that this mutes the internal speakers/headphone jack.) By checking "Show volume in menu bar", you can also change the output device by alt-clicking the menu bar item more conveniently.

Sound settings

Now, run the VLC server:

sox -t coreaudio "Soundflower (2c" -t mp3 -C 96 -q - | \
  vlc - --sout "#standard{access=http,mux=ogg,dst=localhost:8080}" --intf dummy

You can adapt the quality and bit rate with the -C switch (see the SoX documentation). Remove -q to get visual feedback about whether sound is playing.

Finally, on your iOS device, install the iOS VLC client. In the side menu, choose Network Stream and enter http://[YOUR-LOCAL-IP]:8080 to start the stream.

Caveats: This setup is not suitable for real-time applications like gaming or chat because there is a ~2 seconds lag. However, it can be used for watching videos in VLC by shifting the sound track to account for the lag (Window > Track Synchronization).

4
  • 2
    a great solution! thanks. It is recommended to include: brew update-reset && brew update before starting installation
    – Roy
    Jun 6, 2019 at 15:20
  • Doesn't brew update automatically when installing something? By the way, it just occurred to me that one could access an audio input device (Soundflower in this case) directly from VLC using qtsound:// as described here. This way one could avoid SoX as additional sound capturing program. Jun 7, 2019 at 0:34
  • @RobinDinse could you share a walkthrough avoiding SoX? Thanks.
    – user39008
    Sep 17, 2022 at 22:16
  • great, just an update about brew: 'Error: brew cask is no longer a brew command. Use brew <command> --cask instead." So you need to use 'brew install soundflower --cask'
    – Agile Bean
    Oct 6, 2022 at 10:29
11

Yes, using Airfoil for Mac (also available for Windows) and the companion app Airfoil Speakers Touch you can stream any audio from your Mac to your iOS device.

I haven't tried it much myself, and reviews are mixed, but you can try it for free before shelling out the money for it.

This can also be used to send audio from a MacBook to a bluetooth headset connected to an iOS device. Something which is very difficult otherwise.

4
  • 5
    This solution worked, although for live applications, such as watching a movie on netflix, the audio was delayed enough to be annoying. Perhaps I'll delve deep into the Core Audio API and see if I can find a few tools there
    – theck01
    Dec 27, 2011 at 20:33
  • Is Airfoil still the best?
    – Adam_G
    Apr 16, 2019 at 18:25
  • 1
    It definitely works with Airfoil, but personally I wasn't fan to pay 25$ for just a solution in setup I am not sure I will ever use again after this. And seriously, I can't stand the 'hey-use-me-I'm-free-but-I-will-annoy-the-crap-out-of-you-after-15-min-of-freeriding' policy.. May 2, 2019 at 1:26
  • 2
    The major downside to Airfoil is a significant lag, usually about 2 seconds. It doesn't matter for just listening to music, but the audio from Skype or Netflix will be completely out of sync with the video.
    – Adam_G
    Jul 9, 2019 at 16:30
2

In a similar way to @Robin's answer you can use the BlackHole virtual audio driver - which works on newer MacOS versions. A simpler way to do streaming is to use ffpmeg (e.g. brew install ffmpeg). Then direct your audio output to the BlackHole driver (select it as the output device - or include it as part of an aggregate device) and find out which output number it goes to:

ffmpeg -f avfoundation -list_devices true -i ""

Then use the AVFoundation audio device number (e.g. 5) to stream the audio to your_device (You can use your_device.local or it's IP address):

ffmpeg -f avfoundation -i "none:5" -acodec mp3 -f rtp  rtp://your_device:1234

To listen on your_device use the VLC client (e.g. on an iPhone/iPad/MacBook) and go to Network->Open Network Stream and tap in rtp://@:1234

1
1

I used Airfoil and was able to stream music from iTunes (on an iMac running OSX Mavericks 10.9.1) to my iDevices.

I admit the $25 price tag was not something I liked.

However it does work. You can play music from iTunes on a your laptop and simultaneously listen to the music on your iPhone remotely.

You can have the entire house playing the same music through various speakers: your laptop, your iphone and perhaps an imac or ipad.

For me, the price of the $25 is a little easier to swallow than buying a USD $94 Apple Airport Express plus Speakers to connect to the Airport Express.

What's more the Airport Express only has One Audio Jack Port so one speaker for one Airport Express.

Hope this helps.

0

Using the VLC GUI:

  1. install and set up Soundflower
  2. install VLC
  3. set your sound output to the Multi-output device set up for Soundflower (or to Soundflower 2ch directly)

In VLC:

  • File > Open Capture Device
  • Check "Audio" and select Soundflower (2ch)
  • Check "Stream Output" and click "Configure"

described above

  • Select "Stream"
  • Type: HTTP
  • Address: your local IP address
  • Port: 8079 (or a port of your choice)
  • Encapsulation Method: Ogg (or something else)
  • Check "Audio" in transcoding options
  • Select "mp3" for audio (or something else)
  • Select 96kbps for bitrate (or something else)
  • Select two channels (or something else)

described above

  • Press OK and then open the stream
  • On your phone, open VLC and go to the network tab and open the stream at

http://[your local ip]:8079

Unfortunately, this seems to not be very reliable. An alternative is going over the internet with Soundflower and two Discord accounts, or some other method of voice calling yourself.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .