Skip to content

Add blog post: Librosa vs audio processing alternatives - #32

Open
lee101 wants to merge 1 commit into
masterfrom
worktree-agent-a9d61a70
Open

Add blog post: Librosa vs audio processing alternatives#32
lee101 wants to merge 1 commit into
masterfrom
worktree-agent-a9d61a70

Conversation

@lee101

Copy link
Copy Markdown
Owner

Summary

  • New blog post comparing Librosa, torchaudio, scipy.signal, and Parselmouth for Python audio processing
  • Includes feature comparison table, performance benchmarks, code snippets for mel spectrogram in each library, and opinionated usage recommendations
  • Cross-links to existing audio-processing post

Test plan

  • npx hexo generate succeeds with no errors (151 files generated)
  • Post renders at /2026/03/23/librosa-vs-audio-processing-alternatives/

Generated with Claude Code

Compare Librosa, torchaudio, scipy.signal, and Parselmouth with feature
tables, performance benchmarks, code snippets, and usage recommendations.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codex-infinite

Copy link
Copy Markdown

Codex Infinity
Hi! I'm Codex Infinity, your coding agent for this repo.

Start a task on this PR's branch by commenting:

Tasks and logs: https://codex-infinity.com

@netlify

netlifyBot commented Mar 23, 2026

Copy link
Copy Markdown

Deploy Preview for hownz failed.

NameLink
🔨 Latest commitd60e889
🔍 Latest deploy loghttps://app.netlify.com/projects/hownz/deploys/69c09bfc011e9f00083a4cb7

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:d60e8892e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


### torchaudio: PyTorch training pipelines

If your audio features feed into a PyTorch model, torchaudio eliminates the CPU-GPU data transfer bottleneck. Compute spectrograms on GPU, in batch, as part of your `Dataset`/`DataLoader` pipeline. It also supports on-the-fly augmentation (time stretch, frequency masking) that integrates with SpecAugment-style training.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mention torchaudio's maintenance status before recommending it

This section advises readers to choose torchaudio for new PyTorch pipelines, but torchaudio's own stable docs say the project entered a maintenance phase starting in 2.8 and is steering new I/O work toward TorchCodec. Without that caveat, the post can push people starting a fresh stack onto a library whose upstream is actively winding down, which is exactly the kind of context readers need in a comparison article.

Useful? React with 👍 / 👎.

| Librosa | 1.0x (baseline) | Sequential, CPU |
| torchaudio (CPU) | ~0.8x | MKL FFT, batched |
| torchaudio (GPU) | ~0.05x | Batched on A100 |
| scipy.signal (manual) | ~0.9x | Raw STFT only, no mel |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Benchmark SciPy on the same mel-spectrogram workload

The section is introduced as a mel-spectrogram benchmark, but this row explicitly reports only Raw STFT timing for SciPy. Because the manual mel-filterbank application is omitted only for SciPy, the ~0.9x number is not comparable to the Librosa and torchaudio rows and overstates SciPy's performance for the workload the table claims to measure.

Useful? React with 👍 / 👎.

import torchaudio.transforms as T

waveform, sr = torchaudio.load("audio.wav")
mel_transform = T.MelSpectrogram(sample_rate=sr, n_mels=128, n_fft=2048, hop_length=512)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Set matching mel-scale parameters in the comparison code

These snippets are presented as equivalent mel-spectrogram implementations, but the defaults are not aligned: librosa.feature.melspectrogram uses Slaney-style filters by default, while torchaudio.transforms.MelSpectrogram defaults to HTK/no normalization and the manual SciPy example follows the same HTK formula. As written, readers who run the examples on the same file will get systematically different outputs because of parameter mismatches rather than library behavior.

Useful? React with 👍 / 👎.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@lee101