steve228uk / YouTube-Music

:musical_note: A Mac app wrapper for music.youtube.com
https://ytmusic.app
MIT License
2.78k stars 203 forks source link

Airplay on MacOS is choppy from time to time #154

Open wuyuankai opened 2 years ago

wuyuankai commented 2 years ago

Hi I used the YT Music app on my macOS Monterey 12.1 and then use Airplay to output the sound to my Sonos, the audio is choppy from time to time, the sound will cut like 1/4 seconds then resume, sometimes it feels like the volume has been turned down then back up very quickly. I switched to Youtube Music in the browser then start playing, the issue was gone.

Would this be a bug for the YT Music app? Please let me know what info would you need to debug it. Thanks

mickaelhero commented 2 years ago

+1

TimOliver commented 2 years ago

Hi @wuyuankai!

Hmmm. It definitely sounds like a bug in YT Music if running it through Safari is fine.

Something the app has that might be causing it is that in order to try and "force" the "Now Playing" bar on macOS to show YT Music, the app plays a "silence.wav" concurrently in order to maintain control of the system.

If you've got Xcode handy, maybe try commenting out this line of code and seeing if it plays better: https://github.com/steve228uk/YouTube-Music/blob/bcaa2965508ff0adc89c788283965bffb5080c7f/YT%20Music/Controllers/MediaCenter.swift#L134

I'm researching other ways to try and control the "Now Playing" bar. Stay tuned. :)