How Not to Build a Music Player
How Not to Build a Music Player
How Not to Build a Music Player November 13, 2026 The Twelve-Day War made me realize online music players aren’t a viable option for those who live under an oppressive regime that disconnects the internet across the country as a way to silence public opinion.
“如何构建一个糟糕的音乐播放器” 2026年11月13日。“十二日战争”让我意识到,对于那些生活在压迫性政权下的人来说,在线音乐播放器并非可行的选择,因为该政权会通过切断全国互联网来压制公众舆论。
So, as soon as the connection came back, I started archiving tracks and looking for offline alternatives and discovered Strawberry. It’s a feature-rich music player and kept me happy for quite a while, but I have this habit of looking at song lyrics and singing along! Strawberry fetches lyrics from the internet when it recognizes a song, but sometimes the lyrics weren’t line-synced and worse, it displayed the timestamps next to the lyrics which I found pretty annoying to look at. I wasn’t aware of other music players such as foobar2000 which my friend just pointed me to while writing this post.
因此,网络一恢复,我就开始归档曲目并寻找离线替代方案,随后发现了 Strawberry。它是一款功能丰富的音乐播放器,曾让我满意了很长一段时间,但我有个习惯,喜欢看着歌词跟唱!Strawberry 在识别歌曲时会从互联网抓取歌词,但有时歌词无法逐行同步,更糟糕的是,它会在歌词旁边显示时间戳,这让我觉得非常碍眼。当时我并不知道还有 foobar2000 之类的其他播放器,直到写这篇文章时朋友才向我推荐。
I decided to write my own music player and call it AMP with a few goals in mind: minimal feature-set, no C++ dependencies, proper system integration to make it feel like a native app, and of course, write it in Zig (including the shaders!). I also wanted to roll my own UI because of the fun memories of working on V’s UI during my first days of being introduced into system programming. But before I could make any meaningful progress, a new wave of protests started. Following the tragedy of January 8 and 9, another internet blackout began, lasting more than four months.
我决定编写自己的音乐播放器并将其命名为 AMP,目标包括:极简的功能集、无 C++ 依赖、良好的系统集成以使其感觉像原生应用,当然,还要用 Zig 编写(包括着色器!)。我还想自己开发 UI,因为这让我想起刚接触系统编程时开发 V 语言 UI 的美好回忆。但在我取得任何实质性进展之前,新一轮抗议开始了。继 1 月 8 日和 9 日的悲剧之后,又一次互联网封锁开始了,持续了四个多月。
During the blackout, there were these anonymous people on Telegram selling internet access through personal White SIMs, whitelisted servers, Starlink dishes, etc. A black market had formed for the freaking internet! You’d get charged $5 or more for just 1GB of traffic. The prices dropped slightly after a while, but it was still hella expensive. The regime surely made a lot of money out of it. I ended up spending hundreds of dollars on these services and other methods just to stay in touch with my friends and keep my hobbies alive. Killing time was becoming a problem. Especially for someone like me who built their entire social life online.
封锁期间,Telegram 上有一些匿名人士通过个人白名单 SIM 卡、白名单服务器、星链设备等兜售互联网接入服务。互联网竟然形成了一个黑市!仅仅 1GB 的流量就要收费 5 美元甚至更多。过了一段时间价格略有下降,但依然贵得离谱。政权肯定从中赚了不少钱。我最终花费了数百美元在这些服务和其他方法上,只为了与朋友保持联系并维持我的爱好。消磨时间成了一个问题,尤其是对于像我这样整个社交生活都建立在网上的人来说。
I carefully used this slow connection to download repositories, documention, etc. to continue working on my music player. It really brought me immense joy during this hard time. Screenshot from 2026/5/25
我小心翼翼地利用这缓慢的连接下载代码库、文档等,以继续开发我的音乐播放器。在这段艰难的时期,它确实给我带来了巨大的快乐。(2026年5月25日的截图)
Once the connection was mostly restored to the pre-blackout days (UDP traffic is still blocked, though, which naturally also affects QUIC), my attention was shifted towards LLMs. It had become very hard for me to ignore the hype and progress around frontier LLMs. As I really never thought about using them seriously for coding. They are still everywhere in the news, and I was just reminded that I owned a Claude Max 20x subscription gift from my boss back in 2025. Eating dust and maybe soon expiring. So I decided to give it a try and experiment on my music player. It was a very addictive experience. I literally couldn’t hit the plan limits no matter how hard I tried, so after a few non-stop days of prompting, a good chunk of AMP was vibecoded..
当连接基本恢复到封锁前的水平(尽管 UDP 流量仍被屏蔽,这自然也影响了 QUIC)后,我的注意力转向了大型语言模型(LLM)。我很难再忽视围绕前沿 LLM 的炒作和进展,因为我从未想过认真地将它们用于编程。新闻里到处都是它们的消息,我突然想起自己还有老板在 2025 年赠送的 Claude Max 20x 订阅。它一直闲置着,可能快过期了。于是我决定试一试,在我的音乐播放器上做实验。这是一种非常令人上瘾的体验。无论我怎么努力,都无法触及计划的限制,所以在连续几天不停地提示后,AMP 的很大一部分代码都是通过“感觉”写出来的。
At the time, I thought this was an okay approach for a hobby project and I could just un-slopify it later. Little did I know I’m mentally incapable of reviewing tens of thousands lines of code. Shortly after, Anthropic figured that I live in Iran and instantly banned my account. Then Codeberg announced its no-AI policy, which gave me two choices. Either get rid of all that slop or move the repository elsewhere. Going with the former option, I started reading every single line of code, rewriting them. I was surprised by my own ignorance and how much LLMs like to complicate stuff. (I wish I could show an example, but my memory is extremely fragile and I’ve got no pre-rewrite history of the repo to check).
当时,我认为对于一个业余项目来说这还不错,以后可以再清理那些垃圾代码。但我没想到,我根本没有精力去审查数万行代码。不久之后,Anthropic 发现我住在伊朗,立即封禁了我的账户。随后 Codeberg 宣布了其“禁止 AI”政策,这给了我两个选择:要么删掉所有垃圾代码,要么把代码库搬走。我选择了前者,开始逐行阅读并重写代码。我对自己当初的无知感到惊讶,也惊讶于 LLM 是多么喜欢把事情复杂化。(我希望能举个例子,但我的记忆力非常脆弱,而且我没有重写前的代码库历史记录可供查阅)。
Four months later, nearly half the codebase is gone, and somehow it’s more robust with the same set of features (and more). I regret relying on LLMs in the first place, but hey, lesson learned. That said I think it’s still possible to create a healthy relationship with LLMs as long as you look at them as a fancy IDE feature. A lot of times they are just running long sed or regex commands that are a no-brainer act for humans when done by hand but still consumes a good time. For now and hopefully forever I think I’ll be going the old school way. Never rush your hobbies!
四个月后,近一半的代码库消失了,但不知何故,它在保持原有功能(甚至更多)的同时变得更加稳健。我后悔当初依赖 LLM,但嘿,吃一堑长一智。话虽如此,我认为只要将 LLM 视为一种高级的 IDE 功能,还是有可能与它们建立健康的关系。很多时候,它们只是在运行冗长的 sed 或正则表达式命令,这些对于人类手动操作来说是小菜一碟,但确实很耗时。目前,我希望永远坚持老派的做法。永远不要急于求成你的爱好!
Btw this is how AMP looks like right now! v0.1Worth mentioning that the blur shader is written in Zig based on this excellent blog post!.Roadmap to v1.0:Music serverAndroid and Windows supportPackaging for major Linux distrosAny suggestions? ← Zig and GPUs
顺便说一下,这就是 AMP 目前的样子!v0.1。值得一提的是,模糊着色器是基于这篇优秀的博客文章用 Zig 编写的!v1.0 路线图:音乐服务器、Android 和 Windows 支持、主流 Linux 发行版打包。有什么建议吗?← Zig 和 GPU