vincentneo / losslessswitcher Goto Github PK
View Code? Open in Web Editor NEWAutomated Apple Music Lossless Sample Rate Switching for Audio Devices on Macs.
License: GNU General Public License v3.0
Automated Apple Music Lossless Sample Rate Switching for Audio Devices on Macs.
License: GNU General Public License v3.0
I don't know if this is possible, but could you pause the song, change the sample rate and un-pause the song to avoid the hickup with the sample rate change?
This may just be because I use an EQ software and a weird glitch, but this feature reverts to Default Device constantly. For example, if I open MIDI Setup to verify a bitrate, my selected device will reset. Sometimes I look up and see it just randomly went back to default from my chosen DAC. Really wish there was a way to make it stick to my DAC.
v1.1 build 7/beta 4
Thank you for release this amazing app to solve sample rate problem for Apple Music.
I'm now using BlackHole to loopback audio to AudioUnit Host app like AULab and Hosting AU to use batter EQ plug-in and send the sound to USB DAC,but at now time LosslessSwitcher can only change one device's sample rate at one time, can you add multiple devices sample rate change function ?
as per title.
When a song start playing, there is always a few pauses (or cut offs) for 0.5-1 second then resume playing. Sometimes there are multiple pauses and electromagnetic noise. It happens to ~80% of songs and only happens within the first 0.5-2 seconds of each song. Happens to all streaming and downloaded songs. When I quit the LosslessSwitcher app, it's gone.
MacBook Air: 2020 M1 base model
OS: 13.0.1 (22A400)
LosslessSwitcher: version 1.1, build 14
Apple Music: 1.3.0.138
all up to date
Thanks for help!
I assume this update introduced a new version of Apple Music that no longer triggers the app, and thus the rate doesn't change between songs anymore.
With LosslessSwitcher running, with the latest couple of (beta) versions, the Apple Music app opens in the background on its own. Even when you then quit the Music app, it will open in the background again (and you can see the dot in the dock indicating that the app is running). This does not happen with the current "stable" version of LosslessSwitcher, I've noticed it with the latest beta releases...
Always stay at the same rate and seems not working.
Issue :
I'm currently using Sanoma version 14.0 in conjunction with BlackHole, AU Lab, and a USB-C DAC/Amp. After each switch, the volume is automatically set to the maximum level without user input, which is dangerous.
Summary:
(Of course, thank you for your work. I look forward to use LosslessSwitcher.)
This song is 16/44.1, LosslessSwitcher switches on it to 32/48
https://music.apple.com/ua/album/i-apologize/1242694203?i=1242694347&l=ru
Sonoma, Fiio K7 (if this matters)
when im playing song in 16bit of x sample rate, even when the bit rate changes to 24bit, it would stay on 16bit
Running Version 1.1 Build 14
Playing this album https://music.apple.com/au/album/beats-in-space-068-marie-davidson-dj-mix/1682148235 with LosslessSwitcher active, the sample rate seems to be reset at the start of every track causing at least one ~0.5 second audio dropout on my SMSL M500 external DAC
This happens on every track change, even though all tracks are 16-bit 44.1 kHz ALAC and no switching is necessary
When I quit LosslessSwitcher these dropouts are 100% gone
Would it simply be possible to only reset the sample rate if it's different from the last track that was played?
Support a manual option to apply the currently detected format.
If bit depth detection is disabled, only change the sample rate.
I stream Apple Music from my MacBook Pro to an Airport Express as DAC connected to an amplifier connected to my (external) speakers, but LosslessSwitcher reports that I'm using the MacBook Pro Speakers. Does this mean LosslessSwitcher isn't doing its thing?
Running
$ osascript -e 'tell application "Music" to get properties of current track'
does not return correct sample-rate / bit-depth for lossless tracks.
LosslessSwitcher has the data, I there an easy way for it to make it available to other apps?
Random ideas how to do it:
I've noticed that this app only works on Apple Music content and not local files.
Noticing an issue on the latest beta where music will start playing on its own
Quit the application and couldnt repeat it, enabled it again, paused a track, and it came back, so feel its related to LosslessSwitcher
hi,
I used the app for a couple of times, but I noticed it was writing and reading the disk way more than it needs or should.
I saw it read 55 gigabytes and write 11 in 2 hours.
Would it be possible to pause the playback of a new track at 0:00 for like 2 seconds while switching the quality, so that there is no odd cutting off of the first few seconds of the track?
I use Foobar2000 on an M1 MacMini under Ventura 13.0
I want to get an bit-perfect output - but Foobar2000 use the Mac Audio-MIDI-Settings.
I got an hint from Foobar2000 forum to use the LosslessSwitcher.
But I get this message:
"LosslessSwitcher requires Administrator privileges in order to detect each song's lossless sample rate in the Music app."
My working user on the Mac have no Administrator privileges, I do that for better security.
What should I do?
Have anyone tested LosslessSwitcher on an M1 ARM CPU Mac too?
Version 1.0.0
MacBook Air 2022, macos 13.0
This happens very often when playing downloaded files in Apple Music.
I'm on a quest to achieve the most minimalist menu bar possible (notch Mac here, already using Hidden), any chance to add an option to have shorter sample rate text?
Maybe even some different options
Full: 48.0 kHz
Compact: 48.0
Mini: 48
w/ Bit Depth: 48/24
Not sure if this is something more people would enjoy, but I guess this is easy to implement, I'll take a look on the code and see if I can come up with something.
Hate to bring this assessment but I switched from Beta 4 to 5 and...it didnt work at all, just stuck on whatever my last setting was. Not a single track triggered a bitrate switch. I re-downloaded beta 4 and it immediately 'worked' again (other issues notwithstanding)
Currently using M1 macbook on MacOS Ventura
On some of my playlists LosslessSwitcher chooses the sample rate of the next track rather than the current track. I found the same behaviour on both the current stable version (v1.0.0) as well as the current beta (v1.1 build 5).
Mac OS 12.3.1 (21E258)
Apple Music 1.2.3.56
Looking at the Console for the Apple Music log lines, it appears that both the current track and next track are being logged:
play> cm>> mediaFormatinfo '<private>' , songEnhanced, audioCapabilities: 0x4, 0x4, asbdFormatID = qlac, sdFormatID = alac, lossless, asbdNumChannels = 2, sdNumChannels = 2, sdBitDepth = 16 bit, asbdSampleRate = 44.1 kHz, is not rendering spatial audio
...
play> cm>> mediaFormatinfo '<private>' , songEnhanced, audioCapabilities: 0x0 -> 0x10, 0x0 -> 0x10, asbdFormatID = qlac, sdFormatID = alac, high res lossless, asbdNumChannels = 2, sdNumChannels = 2, sdBitDepth = 24 bit, asbdSampleRate = 96.0 kHz, is not rendering spatial audio
The first line is associated with the current track playing, the second line with the next track in the queue. To deal with this case the approach for determining the sample rate would need to be updated from just taking the most recent log line containing a sample rate to something more sophisticated. I'm not sure if there is enough metadata in the log lines to work out which one is associated with the current playing track?
Interestingly not all my playlists log the next track in this way. I have yet to work out what conditions cause Apple Music to do this.
Thanks for writing this by the way!
Originally posted by 7enso November 8, 2022
My audio device is capable of playing at 192 kHz or more, my speakers are as well (digital in). Due to cable length issues the SPDIF signals get distorted above 96 kHz. So if the sample rate switches above 96 kHz I get distorted audio.
Therefore it would be VERY useful to limit the maximum sample rate to a specific value - al least for me.
I mplementation of that feature would be great!Thanks for the great work already :)
Show both the Current and Detected sample rates and bit depths in the menu bar and dropdown.
If bit depth detection is enabled, show the bit depth for Detected, otherwise just show its sample rate.
Works great when manually performing Play/Pause/Next track but when playing a playlist with different bit rate tracks, it fails to register that the playback has progressed to next track and remains on previous track's bitrate
Seems like Beta 6, build 11 has this issue -
Hi!
I don't even know if this is a bug, or simply an omission, but the app doesn't sync bit depth, only sample rate. So for example, if some song is 24/96, it syncs as 16/96.
Not sure how feasible this would be to implement but it would be nice to be able to toggle Dolby Atmos off and on in LosslessSwitcher instead of having to manually do it in the Apple Music preferences.
Originally posted by Justinwang677 July 6, 2022
Some app don't change automatically so it would be a good idea to add a sample rate changing directly in the drop down menu and also bit depth option too
I am using Chord Mojo DAC/Amp. Doesn't macOS Monterey (version 12.3.1) and Apple Music app support automatic switching of sample rates for device as per the song sample rate?
Thanks
Dear Vincent Neo,
I would like to confirm if the following situation is normal. When I use the LosslessSwitcher, I found that if I am using the radio or playlist function, and the next song's sampling rate is different from the current playing song, the LosslessSwitcher will pre-switch to the next song's sample rate instead of waiting for the current song to finish playing before switching. Is this normal or is it considered a bug?
Best regards,
MDGSC
I am running a late 2015 imac and a current macmini m1 & m2 . The only beta release that reliably changes the sample rate is the hybrid strategy beta in June 2022 before the selectable device beta was added. every beta since the hybrid strategy beta does not work on any of my three macs ,old and new.
Similar to the option to toggle bit depth detection, support manual toggle for whether it attempts to auto-switch. If disabled, continue to do the detection but just dont apply sample rate or bit depth changes.
Hi.
I'm on M1 MacBook Air MacOS 12.3.1, and I found out the sample rate would switch to the next song's sample rate about 1 min too early. Let's say I'm playing a 48kHz track with a 96kHz one on queue. It'll switch to 96kHz while the current 48kHz one still has one minute to go. Wondering if anyone else is experiencing the same issue.
Great work on this Switcher . I’m using a current MacMini M1 . I am occasionally getting dropouts during a song being played . I use this Mini just for music .
As the title, Could LosslessSwitcher support Homebrew installation?
such as
brew install --cask losslessswitcher
Learn more: click me
Thx!
Clicking "Play next" on a 96kbps song while a 44.1khz song is playing switches the bitrate.
Bit Depth Switching of beta11 may have no sound, but the AM shows that it is playing. However, beta10 and earlier versions do not have this issue, although the switching speed is slower compared to beta11. My laptop is an M1 MacBook Air.
In addition to the sample rate, show the bit depth as well.
beta 10/build 15, connected to DAC via USB
Okay so here's my experience with the latest:
With Bit Depth Switching on:
In its current state, I can't consider this functioning as intended
(I dont use this feature, just, assuming I really needed to have the right depth)
With Depth off:
I have an Intel Mac mini connected to an AVR via HDMI. The AVR supports multi-channel and is currently set up for 5.1 playback.
Occasionally I wish to play content in multi-channel. To do this, in Audio MIDI Setup I set Audio Devices > HDMI > Output format to multi-channel (In my case the option is 8 channel).
However, when I have LosslessSwitcher enabled it will switch from multi-channel to stereo.
• I would like LosslessSwitcher either to leave the selection as multi-channel or to dynamically switch channel selection relevant to the number of discrete channels being streamed.
So been beta'ing Build 14 for the past day and find it constantly changes my bit depth, even with it unchecked. Trying turning it on and off to see if it made a difference, and it did not.
First noticed when I opened up Audio Devices and found it was set to 16-bit (instead of my usual 32-bit). Tried manually setting 32-bit several times and selected various different bitrates to trigger a switch, and every time it changed the depth along with it. As one final test before posting this, was listening to a 24/48 track, manually switched to 32/48, then played a 44.1/16 track...and LLS switched to 44/16
Setting my daily back to Build 11 for now
On my 2021 16" MacBook Pro with M1 Pro chip, the app will change the bitrate but not the depth.
Thanks for writing this app!
Updated to Ventura 13.6 and switcher stopped switching. Restarted app, Music, and Mac multiple times, no avail. Stuck on 44.1 or 48. Tested with multiple songs.
Mac Studio
M2 Max
I'm using eqmac and LosslessSwitcher is changing the sample rate of the eqmac audio device, i would like it to change it for the actual output device (which also changes the sample rate for the eqmac device if i do it manually from Audio MIDI Setup).
When choosing a new track or skipping to next track, the bit rate switches back to 48kHz even if the currently playing and next track is at a higher bitrate.
Suggest you keep the bitrate the same unless the new track is different from currently playing track.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.