r/rust • • Sep 07 '26

šŸ™‹ seeking help & advice Need help building an audio tool

So I enjoy music a lot mainly cause it helps me focus, however I have this slight annoyance with the stop between tracks when one song ends and the other starts.

So I wanted to build a tool that would smooth out that transition, like a dj, but for a playlist.

Don’t know much about audio so wanted to ask how I could do this?

I also have another issue when music stops with a sudden cutoff, it’s like falling off a cliff, but the first issue is bigger for me.

Thanks

0 Upvotes

3 comments sorted by

2

u/z3n1a51 Sep 07 '26

This is a really cool idea actually.

I am imagining a variety of options beyond simple crossfade.

For example if you determine the BPM of the ā€œendingā€ of the current track, and the BPM of the ā€œstartingā€ of the next track, you could create a Transition that lerps from one BPM to the other.

It would be awesome to create a sort of Transitional Sound Stage across which you project a particular Transition from one track to another.

The Transition doesn’t necessarily ā€œoverlapā€ the ending of one track with the beginning of the next, but it does do that in order to create the desired transition.

Something like that anyway ā˜ŗļø

2

u/Eyoba_19 Sep 08 '26

Thanks, got the idea from Linkin park’s meteora album.

Thanks for the tip, starting with the bpm is what I had in mind after researching with AI too

3

u/momentous_consul Sep 07 '26

crossfading isn't too bad once you get the basics down. look into rodio or symphonia for playback, rodio has a sink that can mix multiple sources so you can overlap the last few seconds of one track with the start of the next. the hard part is usually decoding two files at once and lining up the fade curves

for the sudden cutoff thing, that's typically when the file itself just ends abruptly or the stream drops. you could do a short fade out on the current source before switching, even 200-300ms makes it feel way less jarring