Title Song: Toss A Coin To Your Witcher
Title Artist: Joey Batey
Link to Song: Toss A Coin To Your Witcher (Lyric Video from The Witcher (Music from the Netflix Origi… – YouTube
Between watching the Super Bowl last night and finishing both seasons of The Witcher this weekend, I wasn’t able to accomplish as much as I had planned to, and I didn’t even look at what I had originally intended to (storing the timestamp data). But my weekend wasn’t without any success and progress.
This weekend I accomplished something that I had thought was going to be a more difficult task and that I probably wasn’t going to try and worry about until later. But, after doing some research, I determined it wasn’t as difficult as I originally thought and that it was something that I needed to implement sooner rather than later. This, was adding a trackbar that would allow the user to scroll through the song to a specific timestamp rather than have to restart the song or only go back a few seconds at a time (which is still something I plan on adding eventually though).
The first step in this process was figuring out if it was even possible, which was answered with a simple Google search. I then found a forum from 2009 that was asking how to do what I desired. I was worried that it was going to be outdated so I proceed with skepticism. But thankfully it wasn’t outdated and after some issues with timers (turns out you have to actually assign the tick function to the timer; it doesn’t do it automatically lol) I had a functioning trackbar. See the video below to see it in action.
I also added pause functionality that allows the user to simply pause the audio and remain at the current position rather than starting it over. This was also a lot easier than I had originally thought thanks to the NAudio NuGet package that I have been using. I was able to find an example in the documentation for how to accomplish this.
Anyway, that is about it. I’m uncertain as to what my next task is actually going to be as it depends on what I end up hyper-focusing on, but it will likely be related to timestamping and storing that data / using it to actually move the lyrics. So, I guess stay tuned. I’ve linked the sources that I used below as well as the video of the functioning trackbar and pause functionality.
Lauren (2/14/2022)
Links:
NAudio Documentation: NAudio/PlayAudioFileWinForms.md at master · naudio/NAudio (github.com)
Trackbar Forum: Audio File Time And Seek Bar – C# | Dream.In.Code (dreamincode.net)
Displaying the Timestamp in Easy-to-Read Form: windows – Convert audio input to time and display it using c# – Stack Overflow
Video:
No responses yet