mirror of
https://github.com/kyleneideck/BackgroundMusic
synced 2024-11-12 23:47:10 +00:00
Rename BGMDevice from "Background Music Device" to "Background Music".
Resolves #116.
This commit is contained in:
parent
243c798ccd
commit
ccac7d7001
5 changed files with 21 additions and 19 deletions
|
@ -150,7 +150,7 @@ static float const kStatusBarIconPadding = 0.25;
|
||||||
NSError* error = [audioDevices setBGMDeviceAsOSDefault];
|
NSError* error = [audioDevices setBGMDeviceAsOSDefault];
|
||||||
if (error) {
|
if (error) {
|
||||||
[self showSetDeviceAsDefaultError:error
|
[self showSetDeviceAsDefaultError:error
|
||||||
message:@"Could not set Background Music Device as your default audio device."
|
message:@"Could not set the Background Music device as your default audio device."
|
||||||
informativeText:@"You might be able to set it yourself."];
|
informativeText:@"You might be able to set it yourself."];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ static float const kStatusBarIconPadding = 0.25;
|
||||||
// TODO: Check whether the driver files are in /Library/Audio/Plug-Ins/HAL and offer to install them if not. Also,
|
// TODO: Check whether the driver files are in /Library/Audio/Plug-Ins/HAL and offer to install them if not. Also,
|
||||||
// it would be nice if we could restart coreaudiod automatically (using launchd).
|
// it would be nice if we could restart coreaudiod automatically (using launchd).
|
||||||
[alert setMessageText:@"Could not find the Background Music virtual audio device."];
|
[alert setMessageText:@"Could not find the Background Music virtual audio device."];
|
||||||
[alert setInformativeText:@"Make sure you've installed Background Music.driver to /Library/Audio/Plug-Ins/HAL and restarted coreaudiod (e.g. \"sudo killall coreaudiod\")."];
|
[alert setInformativeText:@"Make sure you've installed Background Music Device.driver to /Library/Audio/Plug-Ins/HAL and restarted coreaudiod (e.g. \"sudo killall coreaudiod\")."];
|
||||||
} else if (code == kBGMErrorCode_OutputDeviceNotFound) {
|
} else if (code == kBGMErrorCode_OutputDeviceNotFound) {
|
||||||
[alert setMessageText:@"Could not find an audio output device."];
|
[alert setMessageText:@"Could not find an audio output device."];
|
||||||
[alert setInformativeText:@"If you do have one installed, this is probably a bug. Sorry about that. Feel free to file an issue on GitHub."];
|
[alert setInformativeText:@"If you do have one installed, this is probably a bug. Sorry about that. Feel free to file an issue on GitHub."];
|
||||||
|
|
|
@ -195,7 +195,7 @@ private:
|
||||||
static pthread_once_t sStaticInitializer;
|
static pthread_once_t sStaticInitializer;
|
||||||
static BGM_Device* __nonnull sInstance;
|
static BGM_Device* __nonnull sInstance;
|
||||||
|
|
||||||
#define kDeviceName "Background Music Device"
|
#define kDeviceName "Background Music"
|
||||||
#define kDeviceManufacturerName "Background Music contributors"
|
#define kDeviceManufacturerName "Background Music contributors"
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
|
|
@ -17,7 +17,7 @@ Device". They're shown in `System Preferences > Sound` along with the real audio
|
||||||
|
|
||||||
When you start BGMApp, it sets BGMDevice as your system's default output device so the system (i.e. Core Audio) will
|
When you start BGMApp, it sets BGMDevice as your system's default output device so the system (i.e. Core Audio) will
|
||||||
start sending all<sup id="a1">[1](#f1)</sup> your audio data to BGMDriver. BGMDriver plays that audio on BGMDevice's
|
start sending all<sup id="a1">[1](#f1)</sup> your audio data to BGMDriver. BGMDriver plays that audio on BGMDevice's
|
||||||
input stream, and the user can record it by selecting "Background Music Device" in QuickTime the same way they'd select
|
input stream, and the user can record it by selecting the Background Music device in QuickTime the same way they'd select
|
||||||
a microphone.
|
a microphone.
|
||||||
|
|
||||||
So that you can still hear the audio, BGMApp starts listening to BGMDevice's input stream and playing the audio out of
|
So that you can still hear the audio, BGMApp starts listening to BGMDevice's input stream and playing the audio out of
|
||||||
|
@ -50,10 +50,10 @@ Nothing](http://www.rossbencina.com/code/real-time-audio-programming-101-time-wa
|
||||||
|
|
||||||
## BGMDriver
|
## BGMDriver
|
||||||
|
|
||||||
The BGMDriver project is an audio driver for a virtual audio device called Background Music Device, which we use to
|
The BGMDriver project is an audio driver for a virtual audio device named "Background Music", which we use to intercept
|
||||||
intercept the audio playing on the user's system. The driver processes the audio data to apply per-app volumes, see if
|
the audio playing on the user's system. The driver processes the audio data to apply per-app volumes, see if the music
|
||||||
the music player is playing, etc. and then writes the audio to BGMDevice's input stream. It's essentially a loopback
|
player is playing, etc. and then writes the audio to BGMDevice's input stream. It's essentially a loopback device with a
|
||||||
device with a few extra features.
|
few extra features.
|
||||||
|
|
||||||
There are quite a few other open-source projects with drivers that do the same
|
There are quite a few other open-source projects with drivers that do the same
|
||||||
thing--[Soundflower](https://github.com/mattingalls/Soundflower) is probably the most well known--but as far as I know
|
thing--[Soundflower](https://github.com/mattingalls/Soundflower) is probably the most well known--but as far as I know
|
||||||
|
|
22
README.md
22
README.md
|
@ -51,11 +51,11 @@ their normal maximum volume.
|
||||||
## Recording system audio
|
## Recording system audio
|
||||||
|
|
||||||
With Background Music running, open QuickTime Player and go `File > New Audio Recording...` (or movie/screen). Then
|
With Background Music running, open QuickTime Player and go `File > New Audio Recording...` (or movie/screen). Then
|
||||||
click the arrow next to the record button that looks like `⌄` and select `Background Music Device` as the input device.
|
click the arrow next to the record button that looks like `⌄` and select `Background Music` as the input device.
|
||||||
|
|
||||||
You should be able to record system audio and a microphone together by creating an [aggregate
|
You should be able to record system audio and a microphone together by creating an [aggregate
|
||||||
device](https://support.apple.com/en-us/HT202000) that combines your input device (usually Built-in Input) with
|
device](https://support.apple.com/en-us/HT202000) that combines your input device (usually Built-in Input) with
|
||||||
Background Music Device. You can create the aggregate device using the Audio MIDI Setup utility from
|
the Background Music device. You can create the aggregate device using the Audio MIDI Setup utility from
|
||||||
`/Applications/Utilities`.
|
`/Applications/Utilities`.
|
||||||
|
|
||||||
## Install from source
|
## Install from source
|
||||||
|
@ -109,9 +109,11 @@ consider submitting a bug report, too.)
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
If Background Music crashes and system audio stops working, open the Sound panel in System Preferences and change your
|
If Background Music crashes and your audio stops working, open the Sound panel in System Preferences and change your
|
||||||
system's default output device to something other than Background Music Device. If it already is, it might help to
|
system's default output device to something other than the Background Music device. If it already is, it might help to
|
||||||
change the default device and then change it back again. Failing that, you might have to uninstall.
|
change the default device and then change it back again.
|
||||||
|
|
||||||
|
Failing that, you might have to uninstall. Consider filing a bug report if you do.
|
||||||
|
|
||||||
## Known issues
|
## Known issues
|
||||||
|
|
||||||
|
@ -124,13 +126,13 @@ change the default device and then change it back again. Failing that, you might
|
||||||
General tab of Skype's preferences.
|
General tab of Skype's preferences.
|
||||||
- Plugging in or unplugging headphones when Background Music isn't running can silence system audio. To fix it, go to
|
- Plugging in or unplugging headphones when Background Music isn't running can silence system audio. To fix it, go to
|
||||||
the Sound section in System Preferences, click the Output tab and change your default output device to something other
|
the Sound section in System Preferences, click the Output tab and change your default output device to something other
|
||||||
than Background Music Device. Alternatively, you may Option+Click on the Sound icon in the menu bar to select a
|
than the Background Music device. Alternatively, you may Option+Click on the Sound icon in the menu bar to select a
|
||||||
different output device.
|
different output device.
|
||||||
|
|
||||||
This happens when macOS remembers that Background Music Device was your default audio device the last time you last
|
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.
|
last used (or didn't use) headphones.
|
||||||
- [A recent Chrome bug](https://bugs.chromium.org/p/chromium/issues/detail?id=557620) can stop Chrome from switching to
|
- [A Chrome bug](https://bugs.chromium.org/p/chromium/issues/detail?id=557620) can stop 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
|
Background Music device after you open Background Music. Chrome's audio will still play, but Background Music won't be
|
||||||
aware of it.
|
aware of it.
|
||||||
- Some apps play notification sounds that are only just long enough to trigger an auto-pause. The only workaround right
|
- Some apps play notification sounds that are only just long enough to trigger an auto-pause. The only workaround right
|
||||||
now is to increase the `kPauseDelayNSec` constant in [BGMAutoPauseMusic.mm](/BGMApp/BGMApp/BGMAutoPauseMusic.mm).
|
now is to increase the `kPauseDelayNSec` constant in [BGMAutoPauseMusic.mm](/BGMApp/BGMApp/BGMAutoPauseMusic.mm).
|
||||||
|
|
2
TODO.md
2
TODO.md
|
@ -70,7 +70,7 @@ There are also lots of other TODOs commented around the code.
|
||||||
|
|
||||||
- Should we hide the BGM device when BGMApp isn't running? This would fix the problem of our device being left as the
|
- Should we hide the BGM device when BGMApp isn't running? This would fix the problem of our device being left as the
|
||||||
default device if BGMApp doesn't shutdown properly (because of a crash, hard reset, etc.), which stops the system from
|
default device if BGMApp doesn't shutdown properly (because of a crash, hard reset, etc.), which stops the system from
|
||||||
playing audio. The problem with that is Background Music Device can still be used without BGMApp, to record
|
playing audio. The problem with that is the Background Music device can still be used without BGMApp, to record
|
||||||
system/apps' audio, so ideally the BGM device would be able to just unset itself as the default device when BGMApp
|
system/apps' audio, so ideally the BGM device would be able to just unset itself as the default device when BGMApp
|
||||||
isn't running. For now, I think we should just have `kAudioDevicePropertyDeviceCanBeDefaultDevice` become false.
|
isn't running. For now, I think we should just have `kAudioDevicePropertyDeviceCanBeDefaultDevice` become false.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue