Skip to main content

本周项目:Voltra

· 11 min read

本周我们与Aprile ElcichPaolo Fragomeni会面,讨论了Voltra,这是一款基于Electron的音乐播放器。

🌐 This week we met with Aprile Elcich and Paolo Fragomeni to talk about Voltra, an Electron-powered music player.


什么是 Voltra?

🌐 What is Voltra?

Voltra 是一款面向希望拥有自己音乐的人的音乐播放器。它还是一个商店,你可以根据已有的音乐发现并购买新音乐。它无广告,支持桌面和移动跨平台使用,并且不会监视你的行为。

voltra-artistview

Voltra 适合谁?

🌐 Who is Voltra for?

任何听音乐的人。

🌐 Anyone who listens to music.

是什么促使你创建 Voltra?

🌐 What motivated you to create Voltra?

单选框一直拥有大量听众。它正在从传统广播转向互联网。现在你可以按需租赁音乐——这是单选框的复兴!由于这一变化,许多新产品和服务应运而生,但流媒体广播仍然让别人控制你的音乐以及你体验音乐的方式。

🌐 Radio has has always had a big share of listeners. It’s moving off the airwaves and onto the Internet. Now you can rent music on demand — it’s a radio revival! A lot of new products and services have emerged because of this, but streaming radio still leaves someone else in control of your music and how you experience it.

我们希望有一款完全专注于你拥有的音乐的产品。一款可以轻松发现音乐并直接从艺术家或唱片公司购买新音乐的产品。

🌐 We wanted a product that was entirely focused on music you own. Something that made it easy to discover and buy new music directly from artists or labels.

有免费版本吗?

🌐 Is there a free version?

桌面播放器完全免费。出售你的音乐也免费! 我们不依赖广告收入。

🌐 The desktop player is completely free. Selling your music is also free! We are not ad-supported.

由于该应用是免费的,我们以后可能会开源它。目前我们没有精力来管理这件事。我们对功能和发展方向有非常具体的想法。我们有一个活跃的测试社区,并且非常重视他们的反馈。

🌐 Since the app is free, we may open source it later on. Right now we don’t have the bandwidth to manage that. We also have very specific ideas for features and the direction we want to take things. We have an active beta community and we take our feedback to heart.

你们如何盈利?

🌐 How do you make money?

我们有高级功能!

🌐 We have premium features!

我们的 Voltra 音频档案 是专为音乐设计的云备份服务。我们不会压缩或共享数据块。你的音乐收藏会得到物理备份。

🌐 Our Voltra Audio Archive is a cloud-backup service designed specifically for music. We don’t compress or share data blocks. Your music collection is physically backed up for you.

对于艺术家和唱片公司,我们的 Pro 会员 提供工具,帮助他们触及更多相关的观众,例如分析工具和专业艺术家网页。

🌐 For artists and labels, our Pro Membership offers tools to help them reach more relevant audiences, such as analytics and professional artist webpages.

Voltra 有何不同?

🌐 What makes Voltra different?

设计和可用性对我们来说非常重要。我们希望为听众提供无干扰的聆听体验!市面上有一些有趣的音乐播放器和商店,但它们中的许多比其创造者意识到的要复杂和难用。我们希望让尽可能多的人都能使用 Voltra。

🌐 Design and usability are incredibly important to us. We want to give listeners a distraction-free listening experience! There are a some interesting music players and stores out there. But many of them are more advanced and harder to use than their creators realize. We want to make Voltra accessible to as many people as possible.

我们也不会从艺术家或唱片公司那里抽成。这是我们的一个重要区别点。这一点非常重要,因为它降低了艺术家将音乐推向市场的门槛。

🌐 We also don't take a cut from the artist or the label. That’s a key differentiator for us. It’s really important because it lowers the barrier for artists to get their music to market.

你做出了哪些设计和技术决策?

🌐 What are some design & technical decisions you made?

在设计 Voltra 时,我们参考了原生应用和网页的界面惯例,同时也仔细考虑了可以去掉的部分。我们有一个活跃的私有测试组,过去几个月里他们给了我们重要的反馈。

🌐 While designing Voltra, we considered UI conventions from native apps and the web, we also thought a lot about what we could remove. We have an active private beta group who have given us critical feedback over the last few months.

我们发现专辑封面和摄影对人们来说非常重要。许多播放器只是文件列表。拥有实体专辑的一个很酷的地方是专辑封面,我们希望在 Voltra 桌面应用中强调这一点。

🌐 We found that album art and photography are really important to people. Many players are just lists of files. One of the cool things about owning physical albums is the album art, and we wanted to put emphasis on this in the Voltra desktop app.

voltra-albumview

我们还确保不干扰用户的文件。我们使用文件监控,所以你可以将文件放在任何你想放的位置,我们不会为你重命名或移动文件。我们有一个嵌入式数据库来跟踪被监控目录的状态,因此即使程序没有运行,我们也能跟踪新文件。

🌐 We also made sure not to mess with people's files. We use file watching so you can put your files wherever you want, and we don't rename them or move them for you. We have an embedded database to track the state of the watched directories so that we can track what's new, even when the process isn't running.

在构建 Voltra 时,你遇到了哪些挑战?

🌐 What are some challenges you've faced while building Voltra?

我们花了很多时间关注性能。我们起初使用框架,但后来转向了原生 JavaScript。根据我们的经验,它们提供的通用抽象优势大于它们带来的性能损耗和繁琐的使用进程。

🌐 We spend a lot of time focused on performance. We started with frameworks but moved to vanilla Javascript. In our experience, the generalized abstractions they provide outweigh the performance penalties and ceremony that they introduce.

我们现在可以很好地处理非常大的收藏。大收藏可能意味着成千上万张图片!由于在渲染进程中可以直接使用 Node.js 的文件系统模块,这使得根据 DOM 事件快速延迟加载和卸载大量图片变得非常容易。

🌐 We handle very large collections pretty well at this point. Large collections means possibly tens of thousands of images! Having Node.js’ file system module directly available from the render process made it really easy to lazy load and unload lots of images super quickly based on DOM events.

一般来说,setImmediaterequestIdleCallback 一直是执行大量处理同时保持 UI 响应的重要工具。更具体地说,将 CPU 密集型任务分配到独立的进程中确实有助于保持用户界面的响应性。例如,我们将实际的音频上下文移到一个独立的进程中,通过 IPC 与其通信,以避免因繁忙的 UI 而可能出现的中断。

🌐 In general setImmediate and requestIdleCallback have been super important tools for performing lots of processing while keeping the UI responsive. More specifically, distributing CPU-bound tasks into separate processes really helps to keep the user interface responsive. For example, we moved the actual audio context into a separate process, communicating with it over IPC to avoid potential interruptions from a busy UI.

为什么选择在 Electron 上构建 Voltra?

🌐 Why did you choose to build Voltra on Electron?

浏览器的沙箱对我们的应用来说限制太多。但我们也在开发一个网页播放器。因此,几乎可以在两种实现之间共享 100% 的代码,这是一个巨大的胜利。

🌐 The browser’s sandbox is too restricted for our app. But we are also developing a web player. So it’s a huge win that we can share almost 100% of the code between the two implementations.

我们最初是用 Swift 开发原生应用。我们发现的主要问题是,我们重复造了很多轮子。网络拥有世界上最大的开源生态系统。因此,我们很快就转向了使用 Electron。

🌐 We actually started by building a native app with Swift. The main problem we found was that we were reinventing a lot of things. The web has the world’s largest open source eco-system. So we pretty quickly switched to Electron.

此外,最重要的是,使用 Electron 你只需开发一次,它就应该能在所有主要平台上正常运行™。虽然不能保证绝对无误,但为每个平台进行原生编码的成本肯定超过 Electron 所引入的其他任何成本。

🌐 Also, and most importantly, with Electron you develop once and it should Just Work™ on all the major platforms. It’s not guaranteed, but the cost of coding natively for each platform definitely outweighs any other costs that electron introduces.

你最喜欢 Electron 的哪些方面?

🌐 What are your favorite things about Electron?

太棒了!:将 Node.js 的网络栈和 Chromium 的呈现层打包在一起,是高效完成任务的秘诀。

能力:这只是网络技术栈,所以我们整个团队实际上都参与了产品的开发。

社区:有一个高度有组织的社区,他们非常善于沟通!有了这样的支持,我们在开发进程中感觉非常棒。

Electron 可以在哪些方面改进?

🌐 In what areas could Electron be improved?

我们希望看到 Electron 支持一个统一的打包工具。这个打包工具对于 Electron 的重要性,相当于包管理器对 Node 的重要性。用户社区中有多个打包工具,每个工具都有其有趣的特性,但也各有缺陷。社区达成共识将有助于引导贡献者的精力投入方向。

🌐 We would like to see Electron endorse a single packager. The packager is as important to Electron what the package manager is to Node. There are multiple packagers in user-land, each with interesting features but each with bugs. Consensus by the community would help to direct the energy being spent by contributors.

下一步计划是什么?

🌐 What's coming next?

我们目前正在开发一款移动应用,并与艺术家和唱片公司合作,将他们的音乐加入 Voltra 商店。嘿!如果你是艺术家或唱片公司,立即注册吧!我们计划在达成一千万首曲目的目标后开放商店。

🌐 We‘re currently developing a mobile app, and working with artists and labels to add their music to the Voltra shop. Hey! If you’re an artist or label, sign up now! We plan on opening up the shop when we reach our goal of 10 million tracks.