BackgroundMusic

2025-12-10 0 827

Background Music

macOS audio utility

Overview
      Auto-pause music
      Application volume
      Recording system audio
Download
Run / Configure
Build and Install
Uninstall
Troubleshooting
Related Projects
License

Overview

  • Automatically pause/unpause your music player when other audio sources are playing/stopped
  • Per-application volume control
  • Record system audio
  • No restart required to install
Note: Background Music is still in alpha.

Auto-pause music

Background Music automatically pauses your music player when a second audio source is playing and unpauses the player when the second source has stopped.

The auto-pause feature currently supports following music players:

  • iTunes
  • Spotify
  • VLC
  • VOX
  • Decibel
  • Hermes
  • Swinsian
  • GPMDP

Adding support for a new music player is usually straightforward.1 If you don\’t know how to program, or just don\’t feel
like it, feel free to create an issue. Otherwise, see
BGMMusicPlayer.h.

Application volume

Background Music provides a volume slider for each application running your system. You can boost quiet applications above their maximum volume.

Recording system audio

You can record system audio with Background Music. With Background Music running, launch QuickTime Player and select File > New Audio Recording (or New Screen Recording, New Movie Recording). Then click the dropdown menu () next to the record button and select Background Music as the input device.

You can record system audio and a microphone together by creating an aggregate
device that combines your input device (usually Built-in Input) with
the Background Music device. You can create the aggregate device using the Audio MIDI Setup utility under
/Applications/Utilities.

Download

Requires macOS 10.13+.

You can download the current version of Background Music using the following options. We also have snapshot builds.

Option 1

Download version 0.4.3:

BackgroundMusic-0.4.3.pkg (771 KB)

MD5: 8c3bfe26c9cdf27365b9843f719ef188
SHA256: c1c48a37c83af44ce50bee68879856c96b2f6c97360ce461b1c7d653515be7fd
PGP:
sig,
key (0595DF814E41A6F69334C5E2CAA8D9B8E39EC18C)

Option 2

Install using Homebrew by running the following command in Terminal:

brew install --cask background-music

Run / Configure

Just run Applications > Background Music.app! Background Music sets itself as your default output device under
System Settings > Sound when it starts up (and sets it back on Quit).

Launch at Startup (Optional)

Add Background Music to System Settings > General > Login Items.

Installing from Source Code

Background Music usually takes less than a minute to build. You need Xcode version
10 or higher.

Option 1

  1. Open Terminal.
  2. Copy and paste the following command into Terminal:
(set -eo pipefail; URL=\'https://g*ithu*b*.com/kyleneideck/BackgroundMusic/archive/master.tar.gz\'; \\
    cd $(mktemp -d); echo Downloading $URL to $(pwd); curl -qfL# $URL | gzcat - | tar x && \\
    /bin/bash BackgroundMusic-master/build_and_install.sh -w && rm -rf BackgroundMusic-master)
More info…

This command uses /bin/bash instead of bash in case someone has a nonstandard Bash in their $PATH. However, it doesn\’t do this for tar or curl. In addition, build_and_install.sh doesn\’t call programs by absolute paths. This command also uses gzcat - | tar x instead of tar xz because gzcat will also check the file\’s integrity (gzip files
include a checksum), and will ensure that a half-downloaded copy of build_and_install.sh doesn\’t run.

Option 2

  1. Clone or download the project.
  2. If the project is in a zip, unzip it.
  3. Open Terminal and change the directory to the
    directory containing the project.
  4. Run: /bin/bash build_and_install.sh.

The script restarts the system audio process (coreaudiod) at the end of the installation, so pause any applications
playing audio if you can.

To manually build and install, see MANUAL_INSTALL.md.

Uninstall

To uninstall Background Music from your system, follow these steps:

  1. Open Terminal.
  2. To locate uninstall.sh, run: cd /Applications/Background\\ Music.app/Contents/Resources/.
  3. Run: bash uninstall.sh.

If you cannot locate uninstall.sh, you can download the project again.

To manually uninstall, see MANUAL_UNINSTALL.md.

Troubleshooting

If Background Music crashes and your audio stops working, open System Settings > Sound and change your
system\’s default output device to something other than the Background Music device. If it already is, then
change the default device and then change it back again.

Make sure you allow \”microphone access\” when you first run Background Music. If you denied it, go to
System Settings > Security & Privacy > Privacy > Microphone, find Background Music in the list
and check the box next to it. Background Music doesn\’t actually listen to your microphone. It needs
the permission because it gets your system audio from its virtual input device, which macOS counts
as a microphone. (We\’re working on it in #177.)

If the volume slider for an app isn\’t working, try looking in More Apps for entries like Some App (Helper). For some meeting or video chat apps, you may need to do this to change the current
meeting volume.

Known issues and solutions

  • Setting an application\’s volume above 50% can cause clipping.

    • Set your volume to its maximum level and lower the volumes of other applications.
  • Only 2-channel (stereo) audio devices are currently supported for output.

  • VLC pauses iTunes or Spotify when playing, and stops Background Music from unpausing your music afterward.

    • Under VLC\’s preferences, select Show All. Navigate to Interface > Main interfaces > macosx and change Control external music players to either Do nothing or Pause and resume iTunes/Spotify.
  • Skype pauses iTunes during calls.

    • To disable this, uncheck Pause iTunes during calls on the General tab of Skype\’s preferences.
  • Plugging in or unplugging headphones when Background Music isn\’t running causes silence in the system audio.

    • Navigate to System Settings > Sound. Click the Output tab and change your default output device to something other than the Background Music device. Alternatively, press Option + Click on the sound icon within the menu bar to select a different output device. This happens when macOS remembers that the Background Music device was your default audio device the last time you used (or didn\’t use) headphones.
  • A Chrome bug stops Chrome from switching to the Background Music device after you open Background Music.

    • Chrome\’s audio will still play, but Background Music won\’t be aware of it.
  • Some applications play notification sounds that are only just long enough to trigger an auto-pause.

    • Increase the kPauseDelayNSec constant in BGMAutoPauseMusic.mm. It will increase your music\’s overlap time over other audio, so don\’t increase it too much. See #5 for details.

Many other issues are listed in TODO.md and in GitHub
Issues.

Related projects

  • Core Audio User-Space Driver
    Examples
    The sample code from Apple that BGMDriver is based on.
  • Soundflower – \”MacOS system extension that allows applications to pass
    audio to other applications.\”
  • WavTap – \”globally capture whatever your mac is playing—-as simply as a screenshot\”
  • eqMac, GitHub – \”System-wide Audio Equalizer for the Mac\”
  • llaudio – \”An old piece of work to reverse engineer the Mac OSX
    user/kernel audio interface. Shows how to read audio straight out of the kernel as you would on Darwin (where most the
    OSX goodness is missing)\”
  • mute.fm, GitHub (Windows) – Auto-pause music
  • Jack OS X – \”A Jack audio connection kit implementation for Mac OS X\”
  • PulseAudio OS X – \”PulseAudio for Mac OS X\”
  • Sound Pusher – \”Virtual audio device, real-time encoder and SPDIF forwarder for
    Mac OS X\”
  • Zirkonium – \”An infrastructure and application for multi-channel sound
    spatialization on MacOS X.\”
  • BlackHole – \”a modern macOS virtual audio driver that allows applications to pass audio to other applications with zero additional latency.\”

Non-free

  • Audio Hijack, SoundSource – \”Capture
    Audio From Anywhere on Your Mac\”, \”Get truly powerful control over all the audio on your Mac!\”
  • Sound Siphon, Sound Control – System/app audio recording, per-app volumes, system audio equaliser
  • SoundBunny – \”Control application volume independently.\”
  • Boom 2 – \”The Best Volume Booster & Equalizer For Mac\”

License

Copyright © 2016-2024 Background Music contributors.
Licensed under GPLv2, or any later version.

Background Music includes code from:

  • Core Audio User-Space Driver
    Examples, original
    license, Copyright (C) 2013 Apple Inc. All Rights Reserved.
  • Core Audio Utility
    Classes,
    original license, Copyright (C) 2014 Apple Inc. All Rights Reserved.

[1] However, if the music player doesn\’t support AppleScript, or doesn\’t support the events Background
Music needs (isPlaying, isPaused, play and pause), it can take significantly more effort to add. (And in some
cases would require changes to the music player itself.) ↩

下载源码

通过命令行克隆项目:

git clone https://github.com/kyleneideck/BackgroundMusic.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 编程相关 BackgroundMusic https://www.zuozi.net/33606.html

compiler explorer
上一篇: compiler explorer
rpcs3
下一篇: rpcs3
常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务