In this project, the author tackles the challenge of overlaying a looping music track over a voice soundtrack using the ffmpeg command in Go. The initial function, loopBackgroundMusic, encounters a problem where the voice track is cut off when the music loop finishes. To address this, the author introduces the “abomination,” a complex solution involving streaming music, creating a backup file, and looping the audio file. After several iterations, the final solution involves using io.Pipe to create a scalable and robust audio stream that loops enough times for the entire voice track. The author invites readers facing similar challenges to reach out for assistance.
https://poxate.com/blog/golang-pipeline-abomination