Skip to main content

Technology Review

Spotify

Selecting the right audio technology was a critical aspect of our project, as it directly influenced the user experience and the system’s ability to provide an immersive and interactive environment. Our goal was to integrate a flexible, scalable, and legally compliant solution that allowed users to bring their own music into the system while ensuring smooth playback and real-time interaction.

Originally, we planned on integrating with Spotify to allow users to select songs from their vast library. We chose Spotify initially due to our team’s prior familiarity with its Web APIs and robust playback features.

Our first approach involved using Spotify’s Web Playback Software Developer Kit (SDK), which enables applications to function as standalone Spotify playback devices, similar to native Spotify apps [1]. During the early stages of our project, we successfully built a prototype using React that ran smoothly within a browser environment, complete with full login, authentication, and credential management.

However, when transitioning this functionality to our final Electron-based desktop application, we encountered significant issues. While the majority of Spotify’s APIs functioned as intended, playback consistently failed, returning a “Playback Error 500,” an error that Spotify’s documentation indicated should not occur under normal circumstances [2].

Further investigation revealed that this playback error was due to Spotify’s implementation of Widevine, a Content Decryption Module (CDM) developed by Google for Digital Rights Management (DRM). Spotify utilises Widevine to protect its audio streams from unauthorised access by securely decrypting audio in-browser environments such as Google Chrome, which has native Widevine support [3]. Electron, however, lacks native Widevine support, resulting in playback failing due to Spotify’s DRM restrictions. Attempts to manually integrate Widevine into Electron using a specialised Electron fork (Cast Labs) [4] were partially successful—audio would briefly play (approximately 30 seconds) before Spotify’s strict playback environment checks led to playback abruptly stopping, causing additional unpredictable behaviours like phantom skipping of songs. Consequently, Spotify’s Web Playback SDK proved unusable for our executable desktop application.

As an alternative, we explored leveraging Spotify’s native application as the primary player, synchronising our visuals via their Web API using the Audio Features and Audio Analysis endpoints. These endpoints would have provided real-time song information, such as beats and musical features, to control aspects of our sensory room (e.g., lighting). Unfortunately, Spotify deprecated these critical API endpoints in November 2024, citing their intention to build a more secure platform [5]. Despite Spotify promising replacement endpoints within a week of the announcement [6], four months have since elapsed without any new API releases.

Due to these persistent technical barriers, we ultimately abandoned Spotify integration. We instead pivoted towards a solution involving custom audio analysis performed on songs downloaded from YouTube, uploaded directly to our application, or recorded from system audio. This alternative provided greater flexibility, reliability, and overall control over the sensory experience.


References

[1] Spotify. “Web Playback SDK | Spotify for Developers.” Accessed: Mar. 22, 2025. [Online]. Available: https://developer.spotify.com/documentation/web-playback-sdk

[2] Spotify. “API calls | Spotify for Developers.” Accessed: Mar. 22, 2025. [Online]. Available: https://developer.spotify.com/documentation/web-api/concepts/api-calls

[3] Google. “Widevine DRM - Google Widevine.” Accessed: Mar. 22, 2025. [Online]. Available: https://www.widevine.com

[4] Cast Labs. “electron-releases: CastLabs Electron for Content Security.” Accessed: Mar. 22, 2025. [Online]. Available: https://github.com/castlabs/electron-releases

[5] Spotify. “Introducing some changes to our Web API | Spotify for Developers.” Accessed: Mar. 22, 2025. [Online]. Available: https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api

[6] Spotify Community. “About the latest changes to current Web APIs (Deprecations).” Accessed: Mar. 22, 2025. [Online]. Available: https://community.spotify.com/t5/Spotify-for-Developers/About-the-latest-changes-to-current-Web-APIs-Deprecations/td-p/6547114