Bleuzen / SpotRec

Spotify desktop client recorder for PulseAudio
MIT License
75 stars 17 forks source link

Recording starts too late #19

Open lewumpy opened 2 years ago

lewumpy commented 2 years ago

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 commented 2 years ago

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: https://github.com/Bleuzen/SpotRec/blob/eda66b1b7ab398f4d0390a1b6d28739cc1efcaaa/spotrec.py#L52

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 commented 2 years ago

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 commented 2 years ago

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

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