Comment by AuthAuth
If you use streaming you can link it to lastfm or Listenbrainz(open source alternative). It will automagically scrobble your listening over.
Otherwise you need to find a music player that supports it or has a plugin to add the functionality. I use tauron for scrobbling my local listening.