---
title: "Friday fun: inspecting audio files from my terminal"
description: soxi shows audio file metadata like sample rate, duration, and channels from the command line. Inspect files before sending them to any voice API.
canonical: https://lukeocodes.dev/friday-fun-inspecting-audio-files-terminal
type: article
locale: en_GB
published: 2026-05-08T00:00:00.000Z
modified: 2026-05-08T00:00:00.000Z
authors:
  - Luke Oliff
section: TIL
tags:
  - TIL
  - Engineering
  - Voice AI
feed: https://lukeocodes.dev/rss.xml
search: https://lukeocodes.dev/search.json?q={query}
schema:
  - "@context": https://schema.org
    "@graph":
      - "@type": Organization
        "@id": https://ably.com/#organization
        name: Ably
        url: https://ably.com
      - "@type": WebSite
        "@id": https://lukeocodes.dev/#website
        url: https://lukeocodes.dev
        name: Luke Oliff
        alternateName: lukeocodes
        inLanguage: en
        publisher:
          "@id": https://lukeocodes.dev/authors/luke#person
        description: Personal blog and writing by Luke Oliff — developer relations, voice AI, developer experience.
        potentialAction:
          - "@type": SearchAction
            target:
              "@type": EntryPoint
              urlTemplate: https://lukeocodes.dev/blog/search?q={search_term_string}
            query-input: required name=search_term_string
      - "@type": Person
        "@id": https://lukeocodes.dev/authors/luke#person
        name: Luke Oliff
        url: https://lukeocodes.dev/authors/luke
        description: Staff engineer and Staff Tech Lead for Developer Experience at Ably. Writing about developer relations, AI, and the voice industry, from the UK.
        mainEntityOfPage: https://lukeocodes.dev/authors/luke
        givenName: Luke
        familyName: Oliff
        image: https://lukeocodes.dev/authors/luke.jpg
        jobTitle: Staff Tech Lead, Developer Experience
        worksFor:
          "@id": https://ably.com/#organization
        sameAs:
          - https://www.linkedin.com/in/lukeocodes
          - https://github.com/lukeocodes
          - https://bsky.app/profile/lukeocodes.dev
          - https://x.com/lukeocodes
          - https://hashnode.com/@lukeocodes
          - https://dev.to/lukeocodes
        knowsAbout:
          - Developer Relations
          - Developer Experience
          - Voice AI
          - Text-to-Speech
          - Answer Engine Optimisation
          - Search Engine Optimisation
          - Open Source
          - Developer Tooling
          - API Design
          - Speech-to-Text
          - Voice Agents
          - Community Building
        knowsLanguage:
          - English
        nationality: British
        alumniOf:
          - "@type": Organization
            name: The Open University
  - "@context": https://schema.org
    "@graph":
      - "@type": Organization
        "@id": https://ably.com/#organization
        name: Ably
        url: https://ably.com
      - "@type": Person
        "@id": https://lukeocodes.dev/authors/luke#person
        name: Luke Oliff
        url: https://lukeocodes.dev/authors/luke
        description: Staff engineer and Staff Tech Lead for Developer Experience at Ably. Writing about developer relations, AI, and the voice industry, from the UK.
        mainEntityOfPage: https://lukeocodes.dev/authors/luke
        givenName: Luke
        familyName: Oliff
        image: https://lukeocodes.dev/authors/luke.jpg
        jobTitle: Staff Tech Lead, Developer Experience
        worksFor:
          "@id": https://ably.com/#organization
        sameAs:
          - https://www.linkedin.com/in/lukeocodes
          - https://github.com/lukeocodes
          - https://bsky.app/profile/lukeocodes.dev
          - https://x.com/lukeocodes
          - https://hashnode.com/@lukeocodes
          - https://dev.to/lukeocodes
        knowsAbout:
          - Developer Relations
          - Developer Experience
          - Voice AI
          - Text-to-Speech
          - Answer Engine Optimisation
          - Search Engine Optimisation
          - Open Source
          - Developer Tooling
          - API Design
          - Speech-to-Text
          - Voice Agents
          - Community Building
        knowsLanguage:
          - English
        nationality: British
        alumniOf:
          - "@type": Organization
            name: The Open University
      - "@type": BlogPosting
        "@id": https://lukeocodes.dev/friday-fun-inspecting-audio-files-terminal#article
        headline: "Friday fun: inspecting audio files from my terminal"
        alternativeHeadline: "Friday fun: inspecting audio files from my terminal"
        description: soxi shows audio file metadata like sample rate, duration, and channels from the command line. Inspect files before sending them to any voice API.
        datePublished: 2026-05-08T00:00:00.000Z
        dateModified: 2026-05-08T00:00:00.000Z
        url: https://lukeocodes.dev/friday-fun-inspecting-audio-files-terminal
        mainEntityOfPage: https://lukeocodes.dev/friday-fun-inspecting-audio-files-terminal
        inLanguage: en
        author:
          - "@id": https://lukeocodes.dev/authors/luke#person
        isPartOf:
          "@id": https://lukeocodes.dev/#website
        keywords: TIL, Engineering, Voice AI
        articleSection: TIL
        about:
          - "@type": Thing
            name: Voice AI
        abstract: I discovered something I should have known years ago. You can inspect audio files from your terminal without opening a single GUI tool, and the output is readably human.
        speakable:
          "@type": SpeakableSpecification
          cssSelector:
            - .post-tldr
            - h1
        image: https://lukeocodes.dev/blog/friday-fun-inspecting-audio-files-terminal/hero.png
        wordCount: 640
        timeRequired: PT4M
        publisher:
          "@id": https://ably.com/#organization
      - "@type": BreadcrumbList
        itemListElement:
          - "@type": ListItem
            position: 1
            name: Home
            item: https://lukeocodes.dev
          - "@type": ListItem
            position: 2
            name: Writing
            item: https://lukeocodes.dev/blog
          - "@type": ListItem
            position: 3
            name: "Friday fun: inspecting audio files from my terminal"
            item: https://lukeocodes.dev/friday-fun-inspecting-audio-files-terminal
---

[Luke Oliff.](/)

- [Blog](/blog)
- [CV](/cv)
- [Uses](/uses)
- [User manual](/user-manual)
- [Living with ADHD](/living-and-working-with-adhd)
- [RSS](/rss.xml)

[Luke Oliff · Writing](/blog)

# Friday fun: inspecting audio files from my terminal

May 2026 · [TIL](/blog/category/til) · 4 min read · [Luke Oliff](/authors/luke)

I discovered something I should have known years ago. You can inspect audio files from your terminal without opening a single GUI tool, and the output is readably human.

```bash
soxi audio.wav
```

That one command prints everything you need to know about an audio file. Sample rate, bit depth, number of channels, duration, file size. No clicking through Audacity menus, no running a media player, no dragging a file onto a website.

```text
Input File     : 'audio.wav'
Channels       : 1
Sample Rate    : 16000
Precision      : 16-bit
Duration       : 00:03:42.15 = 3554400 samples ~ 16661 CDDA sectors
File Size      : 7.11M
Bit Rate       : 256k
Sample Encoding: 16-bit Signed Integer PCM
```

That is a perfectly valid mono 16-bit 16kHz WAV file, which is exactly what most speech-to-text APIs expect. When a file fails to transcribe, the first thing I do is run `soxi`. Nine times out of ten the sample rate is 48kHz or the file is stereo or the bit depth is 24-bit and none of that tells me anything useful until `soxi` shows me.

## Where I found it

`sox` is the full audio processing toolkit. Trim, convert, resample, apply effects, mix tracks. It has been around since the 90s and it ships with Homebrew. `soxi` is the read-only sibling that just dumps the header. I installed `sox` years ago for format conversion and never noticed `soxi` existed until I saw someone use it in a debugging walkthrough.

```bash
brew install sox
```

Then `soxi` comes free.

## Why it matters for voice AI

Every voice API pipeline starts with an audio file. If the file is wrong in any dimension, the pipeline fails silently or nonsensically. A stereo recording sent to a mono-only endpoint produces silence on one channel. A 22kHz file resampled without dithering introduces artifacts that degrade transcription. You can chase these for an hour or run `soxi` in three seconds.

The output file size alone tells you something useful. A 30-second mono 16-bit 16kHz WAV is about 960KB. If your file is 5MB for the same duration, something is off. The encoding line tells you whether the API will accept it at all.

### What about ffprobe?

`ffprobe` does the same thing and more. I use it too. But `soxi` output is easier to read at a glance. Less noise, fewer lines, just the fields you actually check.

```bash
ffprobe audio.wav
```

Gives you more detail. `soxi` gives you the four or five values you actually compare against the API spec. Both are fine. Pick the one whose output your eyes parse faster.

## The real reason I wrote this

Because I spent three hours once debugging a pipeline that failed because the audio file was in AIFF format, not WAV. The API returned a generic error. The log said nothing useful. I eventually ran `file audio.aiff` and it said "AIFF audio" and I felt like an idiot. `soxi` would have told me in one line.

Friday fun: your terminal knows more about audio than you do. It always did. You just had to ask.

### FAQ

**What is soxi?** soxi is a command-line tool that reads audio file headers and prints the metadata. It is part of the SoX (Sound eXchange) suite.

**Does soxi work on macOS?** Yes. Install SoX via Homebrew (`brew install sox`) and soxi is included.

**What formats does soxi support?** WAV, AIFF, FLAC, MP3, OGG, and most common audio formats. It reads whatever SoX supports.

**How is soxi different from ffprobe?** soxi output is shorter and focused on the fields you check against API requirements. ffprobe gives more technical detail. Both are useful.

**Can I use soxi in a script?** Yes. Use `soxi -V` for verbose or parse the standard output with grep or awk. It works well in CI pipelines to validate audio files before submission.

[← Newer: 5 developer experience wins in voice AI tooling](/5-developer-experience-wins-voice-ai-tooling)

[All posts](/blog) →

## Search this site

`GET https://lukeocodes.dev/search.json?q=<words>` returns matching posts as JSON, each with its page URL and its markdown URL. Add `&limit=<1-50>` for more than 10. How it works: [/blog/search](https://lukeocodes.dev/blog/search.md).

```sh
curl "https://lukeocodes.dev/search.json?q=developer+relations"
```

---

© 2026 Luke Oliff. Posts live at the root of this site.

- [GitHub](https://github.com/lukeocodes)
- [LinkedIn](https://www.linkedin.com/in/lukeocodes)
- [X](https://x.com/lukeocodes)
- [Bluesky](https://bsky.app/profile/lukeocodes.dev)
- [Email](mailto:luke@lukeoliff.com)
- [RSS](/rss.xml)

## Cookies

This site sets one analytics cookie, from Google Analytics, and only in a browser that accepts the cookie banner. A client that does not run scripts sets no cookies, so there is nothing to accept or decline here.

[Cookie policy](/cookies)
