Nota: Track selection and rotation algorithm

This is a continuation of the previous article on smart radio that does not die when the Internet is lost. It seems that the first pancake was rather lumpy: most users did not like the application. Criticism basically divided into two fronts:

1. The same tracks are very often repeated, and new ones appear very rarely.
2. There is no way to either choose your favorite genres, or minus unsuitable tracks, so as not to have to painfully skip them.

The second problem was greatly aggravated by the first, since omissions very often led to repeats of all the same tracks, albeit in a different sequence.

I’m glad to report that I managed to solve the first problem (the update is already in the Play Store). Under the cut will be a description of the selected algorithm for selecting and rotating tracks, as well as the essence of the correction, which, as I expect, should dramatically improve the user experience.

The basic idea of ​​selecting tracks appeared almost immediately: the probability of choosing a song to play is proportional to its “preference score”. The latter is calculated as the ratio of the average listening time of a track to its duration. This selection method leads to frequent playback of those compositions that are more preferable for the listener. Unfortunately, this assessment will not always correspond to real preference, but should correlate well with it.

According to the initial idea, the rotation of the tracks should occur at the moment when all the tracks were listened at least two times (once it seemed insufficient for a reliable estimation of the track). At the time of rotation, tracks were deleted whose preference score was below a certain level, and a new portion of tracks was loaded.

This algorithm in practice led to a very rare rotation. In fact, tracks that were quickly skipped lost the ability to be listened to again for a long time. Therefore, I had to artificially overestimate my preference score for tracks I’ve listened to less than two times to increase the likelihood of playing them.

In addition, in order to exclude the repetition of the tracks just played back, it was decided to artificially lower the preference score for the last ten tracks played.

In practice, this worked pretty well, but only under the condition of a more or less formed preference profile, when the vast majority of the first twenty loaded tracks do not cause rejection. The new user received a set of completely random tracks that he was forced to skip endlessly. In the first case, gaps were quite rare, and did not cause irritation. In the second - the listener simply could not wait for the next iteration of the rotation.

This was the case in the original version of the application, which was published at the time of writing the previous article. Now about what has been done to improve the user experience:

1. For the next iteration, rotation is now enough for all tracks to be listened to only once (previously there were two times).
2. In the presence of unheard-of compositions, their assessment of preference sharply increases, for all the others, it sharply decreases (both by an order of magnitude).

These changes have led to the fact that when there is an Internet connection, tracks are now played only once (as in regular radio), but the tracks you like are deposited in the cache, crowding out the rest. As soon as the Internet connection is lost, the old mechanism is activated, reproducing the selected tracks in proportion to their assessment of preference.

PS A bug related to the lack of recognition of the appeared WiFi was also fixed.

PPS Release 1.0.2 was broken. I turned on minification and compression of resources, as a result, the application crashes, as pointed out by nikita_dol . I apologize, from now on I will upload updates only through beta versions. I really hope that version 1.0.3 will be working.

All Articles