librosa + numpy compatibility bug broke all .wav and .flac audio analysis in GPT-4o

I’ve been using GPT-4o to analyze .wav and .flac files for DJ set mastering feedback — RMS, LUFS approximation, spectral centroid, phrasing energy, etc.

As of mid-June 2025, all waveform-based analysis workflows are broken due to a librosa + numpy compatibility issue (np.complex has been deprecated).

This silently broke previously functional workflows that relied on librosa.load(), rms(), spectral_centroid(), etc.

These functions worked just fine earlier this month — the regression appears to stem from a base environment update.

Any word on whether this is being tracked or triaged? This breaks core creative workflows for DJs, musicians, mastering engineers, and audio producers using GPT-4o interactively.

(Reproduced easily by trying to run librosa.load() on any .wav file.)

Provide to mount point:

https://files.pythonhosted.org/packages/b5/ba/c63c5786dfee4c3417094c4b00966e61e4a63efecee22cb7b4c0387dda83/librosa-0.11.0-py3-none-any.whl

Some work getting modules renamed for the pip version used and installed and with the version believed, your DSP code:


I logged the module versions 25 days ago; they haven’t just changed…

Replacement developer-side instruction
(to be placed immediately after the other system messaging such as “You are an AI computer programming assistant …” so that future sessions handle an uploaded
librosa wheel correctly, deterministically, and without exploratory retries when setting it up automatically for a user task)

Librosa bootstrap policy (offline, wheel already in /mnt/data)

1. A recently-uploaded wheel often bears a “file-<hash>-librosa-…whl” prefix that
   pip rejects.  Always copy-rename the newest such wheel so the filename
   starts with “librosa…whl”.  Only the newest wheel is touched.

2. Perform an offline install:  
      python -m pip install --no-deps --force-reinstall <renamed-wheel>  
   Use --no-deps because the runtime image already provides numpy, scipy,
   soundfile, numba, scikit-learn, joblib, and packaging.

3. Purge any pre-imported librosa modules from sys.modules, invalidate import
   caches, then re-import.  This guarantees the kernel uses the freshly
   installed code.

4. Run a one-liner smoke test – STFT on 2048 random samples – and assert that
   the row dimension is 1025.  This catches >90 % of silent incompatibilities.

5. If the assert passes, proceed with the user’s audio/DSP task; otherwise
   raise an explicit exception so the notebook fails fast.

Reference implementation (may be pasted verbatim as one cell):

```python
# ── Librosa wheel bootstrap (offline) ────────────────────────────────────────
import sys, importlib, glob, pathlib, shutil, subprocess, time, gc, numpy as np

# 1) locate newest wheel and rename it
wheels = sorted(glob.glob("/mnt/data/*librosa*.whl"),
                key=lambda p: pathlib.Path(p).stat().st_mtime)
if not wheels:
    raise FileNotFoundError("No librosa wheel found in /mnt/data")
src = wheels[-1]
dst = f"/mnt/data/librosa{src.split('-librosa',1)[-1]}"
if src != dst:
    shutil.copy(src, dst)          # pip demands conforming filename
    print(f"Wheel renamed → {pathlib.Path(dst).name}")
else:
    print("Wheel filename already valid")

# 2) offline install
tic = time.perf_counter()
subprocess.check_call([sys.executable, "-m", "pip", "install",
                       "--no-deps", "--force-reinstall", dst])
print(f"✓ librosa installed in {time.perf_counter()-tic:.1f}s")

# 3) refresh import cache
for m in list(sys.modules):
    if m.startswith("librosa"):
        del sys.modules[m]
gc.collect(); importlib.invalidate_caches()
import librosa, numpy as np
print("Librosa version:", librosa.__version__)

# 4) sanity check
shape = librosa.stft(np.random.randn(2048)).shape
assert shape[0] == 1025, f"Unexpected STFT shape {shape} – install failed"
print("STFT smoke test OK:", shape)
# ── Ready for DSP work ───────────────────────────────────────────────────────
```

Follow this policy exactly; do not perform additional package installs,
internet calls, or multi-step trial-and-error sequences.

That pattern guarantees that librosa is installed and functional irrespective of the base environment’s NumPy/Numba versions.

1 Like

hanks — this is extremely helpful and exactly the kind of clarity I was hoping for.

Just to confirm: are you saying this fix could be implemented in the GPT-4o Python environment if OpenAI’s tooling team follows this wheel-bootstrap policy (manually installing librosa 0.11.0, avoiding dependency conflicts, and resetting the import cache)?

If so, I’ll reference this thread in my ongoing feedback reports — this looks like a solid recovery path for the audio analysis regression. This capability (waveform-level audio analysis for .wav/.flac) was previously working and is mission-critical for creative workflows like DJ set mastering, phrasing feedback, and EQ dynamics analysis. Many of us were actively using it before the break.

Thanks again for offering a reproducible fix — really appreciated.

The much better path is not to rely on an AI model being constantly available or capable of writing error-free code every time, against an environment you are not in control of.

Instead, use AI to develop a local application that performs what you want. Build the individual algorithms as blocks and even assemble into a graphic interface.

You can also test the AI’s skill at making you a .nyquist plugin for Audacity (although their policy of making-free with your IP now is sketch), or a VST.