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

Recording starts too late #19

Open
lewumpy opened this issue Dec 8, 2021 · 3 comments
Open

Recording starts too late #19

lewumpy opened this issue Dec 8, 2021 · 3 comments

Comments

@lewumpy
Copy link

lewumpy commented Dec 8, 2021

The recordings start a fraction of a second too late. This is especially noticeable in songs that start directly with a clear sound. Part of the sound is then missing from the recording, so that it is noticeable when listening to it. An example is the following song: https://open.spotify.com/track/6b7WHomwS4t8uNo9zAVqfr?si=c9e1ce747484405c ... There are several such songs on the album that start directly with a sound. Therefore, the problem can be reproduced.

My system is a Manjaro Linux with KDE Plasma Version 5.23.4, spotrec 0.15.1 and Spotify 1.1.72.439

@Bleuzen
Copy link
Owner

Bleuzen commented Dec 18, 2021

Hi, it is hard to get it right. Every system is a little slower/faster. SpotRec already gives ffmpeg some time to start up, but in your case it seems not enough.
For now, you can tweak it by changing this variable in the script:

_recording_time_before_song = 0.25

Currently it is set to a quarter of a second, but you can increase it to for example a half of a second by changing it to:

_recording_time_before_song = 0.5

I may also check your example song / album when I get to that, maybe increase the pre-configured time.


Just out of interest, because it could play a role:
Are you using PulseAudio or Pipewire (as pulse replacement)?

@lewumpy
Copy link
Author

lewumpy commented Dec 20, 2021

Currently it is set to a quarter of a second, but you can increase it to for example a half of a second by changing it to:

_recording_time_before_song = 0.5

Thanks for your reply! I played around with the time a bit. Unfortunately, it did not bring success. Even when I set 5 seconds, there was 5 seconds of silence at the beginning of the song and and still the first sound was cut off anyway. Unfortunately I have no idea if you can make settings for ffmpeg somewhere else.

Just out of interest, because it could play a role: Are you using PulseAudio or Pipewire (as pulse replacement)?

I'm using PulseAudio.

@Rijul-A
Copy link
Contributor

Rijul-A commented Jan 2, 2022

Can you try my working-config branch? The large differences are

  • When a song change is detected, Spotify is paused. This way, the next song does not feature in the current song's recording.
  • Spotify remains paused until time needed to cleanly finish the FFmpeg process.
  • A larger wait time is used between starting a new FFmpeg process and resuming the paused song.

Of course, this method will produce some silence at both ends of the song; this is trimmed later in post-processing.py.

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

3 participants