Giter Site home page Giter Site logo

Time padding after song stops about spotrec HOT 9 CLOSED

bleuzen avatar bleuzen commented on August 17, 2024
Time padding after song stops

from spotrec.

Comments (9)

Bleuzen avatar Bleuzen commented on August 17, 2024 1

As I already wrote here:
#10 (comment)

it is hard to cut the songs accurate and to find good default values for the paddings which work for all users.

I did some testing again and lowered the values for the new version 0.13.0.
It is 1.35 seconds for the ending now and I wouldn't go much lower because it already cut it really close for some songs during my tests.

Feel free to play around with the values and try what fits best in your case.

from spotrec.

NicoHood avatar NicoHood commented on August 17, 2024

I have a really hacky but great idea:
What about adding a song that starts with silence after each recording? If we can modify the queue we could always add a particular song that is played afterwards. This way we could avoid recording other tracks. A bit longer silence is more acceptable than the beginning of a new song.

Wikipedia even has a whole list of that:
https://en.wikipedia.org/wiki/List_of_silent_musical_compositions#Songs

Checkout "Pause by Rob Dougan":
https://open.spotify.com/track/7xUBiCTg33f6fvwzKQsRpH?si=97reKNBbTJWx8NLWZRyaUA

from spotrec.

Bleuzen avatar Bleuzen commented on August 17, 2024

If we can modify the queue [...]

it looks like we can't do that. These are all Spotify mpris methods:

grafik

The only one looking interesting here is "OpenUri(String Uri)".
We can start playing the silence track with this command:
qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri "spotify:track:7xUBiCTg33f6fvwzKQsRpH"
but this plays the song right away, not adding it to the queue. So it is not useful in our case.

from spotrec.

NicoHood avatar NicoHood commented on August 17, 2024

I am no expert, but what about that:
https://specifications.freedesktop.org/mpris-spec/2.2/Track_List_Interface.html

Edit:
We could also use the spotify REST API. This would be even more hacky, but might work XD

from spotrec.

Bleuzen avatar Bleuzen commented on August 17, 2024

I am no expert, but what about that:
https://specifications.freedesktop.org/mpris-spec/2.2/Track_List_Interface.html

Well, I may be missing something, but as far as I see, Spotify doesn't expose this.

We could also use the spotify REST API. This would be even more hacky, but might work XD

While this may be possible...

1.) What about the ads? How do we know if really a silent track is coming next and no ad? We can't insert a silent track before ads.

2.) I don't want to complicate the script too much with things not really necessary for the average user. Will have to see if this will ever be implemented in this repo, but in a fork / PR, everything is possible.

3.) What if someone wants to record exactly that silent track xD

from spotrec.

NicoHood avatar NicoHood commented on August 17, 2024
  1. I think it is worth to pay for spotify, I only record music to play the mp3s with my ipod shuffle. I use it for doing sports, and using my phone is way too large. I would not care about free members.

  2. Correct, it should be optional. As I said, its a really dirty hack, but its the best idea for now it seems

  3. Very unlikely.

from spotrec.

Bleuzen avatar Bleuzen commented on August 17, 2024

SpotRec is not targeted at payed users only, so it has to be optional.
In fact, I can't even test payed only features myself since I'm not using Spotify anymore (only having a free account left for testing SpotRec).

So while your idea might work, you may understand that I'm currently less motivated for implementing such features in SpotRec, while I'm trying to maintain it for those who are still using it.

That said, anyone can fork it and submit a pull request implementing such an option/feature.
Depending on how much it complicates the code, I may consider merging it in this repo.

from spotrec.

NicoHood avatar NicoHood commented on August 17, 2024

Just a quick question that came up to my mind: How do you determine the end of a song? Do you read the song metadata and stop recording after that time has passed or do you watch for a dbus event that tells us the song finished? Did you try both options?

from spotrec.

Bleuzen avatar Bleuzen commented on August 17, 2024

Currently SpotRec listens for the "PropertiesChanged" dbus event of Spotify. When the event is fired, it compares the track id from before and after the event. If the trackid is the same, something else like for example the playback status must have changed. If the trackid is different, SpotRec knows that the song changed / ended and also stops the recording.

There is no internal timer waiting for the length of the song. I haven't tried this option yet and I guess it won't make a (big) difference because this would depend on the song start time being accurate (which also comes from the "PropertiesChanged" event currently in use).

from spotrec.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.