- Dev Notes
- Posts
- How Does Shazam Recognize Songs? A Technical Explanation
How Does Shazam Recognize Songs? A Technical Explanation
Good Morning! Today we’ll take about how Shazam recognizes songs through audio fingerprinting. The Unity SDK release to help mobile games scale their backend infrastructure, and a debate within the FreeBSD community on potentially adopting Rust in parts of the base system.
How Does Shazam Recognize Songs? A Technical Explanation
Music recognition app Shazam can instantly identify songs just from a short audio sample. But how does this magic happen behind the scenes? Here’s a quick technical rundown of the key steps:
Create a spectrogram. When Shazam records an audio sample, it splits the sample into short time slices and runs each through a Fourier transform to determine the prominent frequencies present at each moment. Stacking these frequency spectrums over time creates a spectrogram showing how the frequencies change.
Detect peaks. The spectrogram’s brightest spots indicate the loudest notes. Shazam uses a maximum filter to detect these peak frequencies and map them into a constellation for fingerprinting.
Generate hashes. Shazam creates hashes by pairing up peak frequencies across time to capture unique audio signatures. Each hash contains the two peak frequencies and their time difference.
Match against database. The sample’s hashes are compared to Shazam’s database of song hashes to find matching tracks. Alignment scoring determines which song’s hashes line up best temporally with the sampled hashes.
Return best match. The song whose hashes align most cleanly with the sampled hashes gets returned as the match result.
So in summary, Shazam leverages spectrogram analysis, audio fingerprinting, and efficient hash matching to pinpoint songs with high accuracy. The same principles enable Shazam to recognize TV shows, ads, and more from audio snippets.
Read More Here
Metaplay Launches Unity SDK to Empower Mobile Game Scaling
Helsinki-based Metaplay has announced the launch of a Unity software development kit (SDK) to help mobile game developers seamlessly scale their titles. Developed over four years with top Helsinki studios, the SDK provides fully customizable workflows, libraries and tooling previously only accessible to high-end game studios.
The key value proposition lies in enabling robust backend upgrade paths, allowing developers to scale cloud infrastructure alongside mobile game growth. This addresses a major pain point, as many studios rely on cheap makeshift backends to launch minimal viable products, then struggle tremendously when games gain traction.
Technically, the SDK comprises four components spanning initial code to live ops:
C# game server - Prebuilt with essential social gaming features, but fully extensible via source code access. Enables full control by letting developers deploy into their cloud.
Game database - Manages player data and progression persistence. Focused on flexibility and efficient scaling.
Analytics platform - Provides insights into player behavior and game performance. Helps inform design decisions.
Developer tools - Includes client SDKs, command line tools for workflows, and an admin portal for configuration.
Pricing starts at $1,085/month. The launch paves the way for studios to build more ambitious cloud-connected mobile titles.
Read More Here
Rust in FreeBSD Base System Debated
A discussion on potentially adopting Rust in FreeBSD's base system has drawn mixed opinions from project members. David Chisnall, a FreeBSD contributor and C++ standards committee member, outlined considerations around modernizing FreeBSD's programming languages to improve security and developer productivity.
Chisnall argued FreeBSD should not allow new C code, and recommends static analysis for new C++. For new systems projects needing low-level access, he prefers Rust over C/C++. However, he acknowledged Rust's ecosystem remains unproven in a multi-year timeframe needed for an OS.
On the human side, Chisnall noted competent Rust developers are still scarce compared to C/C++. Attracting enthusiastic open source Rust contributors could significantly aid adoption. He observed most new kernels in the past four years opted for Rust, whereas most in the past 20 years chose C++.
While neither Rust nor C++ fully prevent bugs, Chisnall believes C++'s tooling makes it easier to enforce best practices versus Rust's unrestrained unsafe escapes. Regardless, he feels many existing FreeBSD components could switch to safer languages like Lua without performance impact.
Read More Here
Tech News
Apple Pays $13.4 Million Antitrust Fine to Russia Over App Store Policies
Apple has reportedly paid a $13.4 million (1.2 billion rubles) antitrust fine levied against them by Russia's Federal Antimonopoly Service (FAS) for prohibiting developers from informing iOS app users about alternative payment options outside of Apple's App Store.
The FAS originally ruled in 2021 that these App Store policies violated antitrust laws by giving Apple an unfair competitive advantage. They argued that forcing developers to use Apple's in-app purchase system prevented competition and consumer choice around payment processing fees. From a technical standpoint, Apple has tightly controlled iOS app distribution and monetization through its proprietary App Store. The 30% commission on in-app purchases has also been controversially called the "Apple tax."
Although Apple suspended product sales in Russia after the invasion of Ukraine, Russians can still download apps. Apple risks further regulatory penalties if it does not comply with local laws allowing external payment links within apps. However, permitting alternative in-app purchases would require iOS engineering changes to loosen restrictions on developer commerce functionality. It could also impact Apple's substantial App Store revenue, set an precedent for other markets, and reduce user trust in app security if external links aren't vetted.
Read More Here
Youtube Spotlight
3 Types of Algorithms Every Programmer Needs to Know
Forrest discusses three types of algorithms that every programmer needs to know: sorting algorithms, searching algorithms, and graph algorithms. He provides detailed explanations and code examples for each type of algorithm, emphasizing their real-world use cases and significance in computer science. The importance of understanding these algorithms lies in their role in efficient problem-solving, software optimization, and analytical thinking.
Was this forwarded to you? Sign Up Here