Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS 14.2 貌似 Spotify 歌词会慢个半句这样 #617

Open
DDDD2000 opened this issue Dec 13, 2023 · 8 comments
Open

macOS 14.2 貌似 Spotify 歌词会慢个半句这样 #617

DDDD2000 opened this issue Dec 13, 2023 · 8 comments

Comments

@DDDD2000
Copy link

Apple Music 还是正常的

@scuzniverse
Copy link

我好像也是

@aviwad
Copy link

aviwad commented Apr 17, 2024

Does this only happen when songs autoplay? Like the next song automatically plays? Does pause & playing fix the lag? Because I am facing the same problem in my project https://github.com/aviwad/LyricFever. Was looking here to see if @ddddxxx did anything to fix that

@rqhu1995
Copy link

Does this only happen when songs autoplay? Like the next song automatically plays? Does pause & playing fix the lag? Because I am facing the same problem in my project https://github.com/aviwad/LyricFever. Was looking here to see if @ddddxxx did anything to fix that

Yes, normally if you open Spotify and play the first song after opening the app, there is no lag. Starting from the second song (autoplay), the lag appears. Manually playing another by double clicking a song in the app / pausing and playing / clicking the progress bar of the song can eliminate the lag.

@aviwad
Copy link

aviwad commented Apr 29, 2024

Yes I fixed this problem in my app 😃. The solution is to send an apple script play command on new song to fix the lyric drift. My app will have an update fixing the bug in 1 week time. Will comment here again on the update. Hope you try it 😄

@rqhu1995
Copy link

rqhu1995 commented May 18, 2024

Yes I fixed this problem in my app 😃. The solution is to send an apple script play command on new song to fix the lyric drift. My app will have an update fixing the bug in 1 week time. Will comment here again on the update. Hope you try it 😄

根据这位朋友的提示,用macOS自带的“自动操作”和AppleScript,在每首歌播完切换到下一首后,向Spotify强制发送一个“暂停”+“播放”的指令。这样可以触发LyricsX回到正轨。

property appName : "Spotify+"
property spotifyRunning : false

on run
    -- Launch Spotify
    if not application "Spotify" is running then
        tell application "Spotify" to activate
    end if
    
    set spotifyRunning to true
    my monitorSpotify()
end run

on monitorSpotify()
    repeat while spotifyRunning
        tell application "Spotify"
            if player state is playing then
                set currentTrack to (get name of current track)
                
                -- Wait for a small interval to check the next song
                delay 1
                
                if currentTrack is not (get name of current track) then
                    -- Pause and Play to re-sync lyrics
                    pause
                    delay 1
                    play
                end if
            end if
        end tell
        delay 1
    end repeat
end monitorSpotify

on quit
    -- Quit Spotify when quitting the script
    tell application "Spotify" to quit
    set spotifyRunning to false
    continue quit
end quit

on idle
    -- Check if Spotify is running
    if not application "Spotify" is running then
        quit me
    end if
    
    return 10 -- Check every 10 seconds
end idle

在“自动操作(Automation)”app里,新建一个“应用程序”,然后添加打开LyricsX和Spotify两个操作,之后再添加上面的AppleScript就可以了。

image

P.S. delay的时间或许可以再短点。

@aviwad
Copy link

aviwad commented May 20, 2024

Bro that is a very inefficient solution 💀. Please do not use that. Use my app https://LyricFever.com or you can send a play() command to Spotify via AppleScript. That's all. The play() command corrects the drift.

@rqhu1995
Copy link

Bro that is a very inefficient solution 💀. Please do not use that. Use my app https://LyricFever.com or you can send a play() command to Spotify via AppleScript. That's all. The play() command corrects the drift.

Sorry and thank you for your suggestion.

I've tried LyricFever. It's a super lite and great app but the lyric display can only be at the menubar rather than a floating window. Plus the lyric source depends only on Spotify built-in providers, which is insufficient for many songs.

I'll just modify the AppleScript and use LyricsX for now. Looking forward to the update on LyricFever.

@aviwad
Copy link

aviwad commented Nov 21, 2024

Bro that is a very inefficient solution 💀. Please do not use that. Use my app https://LyricFever.com or you can send a play() command to Spotify via AppleScript. That's all. The play() command corrects the drift.

Sorry and thank you for your suggestion.

I've tried LyricFever. It's a super lite and great app but the lyric display can only be at the menubar rather than a floating window. Plus the lyric source depends only on Spotify built-in providers, which is insufficient for many songs.

I'll just modify the AppleScript and use LyricsX for now. Looking forward to the update on LyricFever.

Hey! I have released a big update that has both floating panels as well as alternate lyrics sources (LRCLIB). A spotify login is still required though.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants