Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8934621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:49:58+00:00 2026-06-15T09:49:58+00:00

I have a big batch of files I’d like to run recognition on using

  • 0

I have a big batch of files I’d like to run recognition on using CMU Sphinx 4. Sphinx requires the following format:

  • 16 khz
  • 16 bit
  • mono
  • little-endian

My files are something like 44100 khz, 32 bit stereo mp3 files. I tried using Tritonus, and then its updated version JavaZoom, to convert using code from bakuzen. However, AudioSystem.getAudioInputStream(File) throws an UnsupportedAudioFileException, and I haven’t been able to figure out why, so I have moved on.

Now I am trying ffmpeg. The command ffmpeg -i input.mp3 -ac 1 -ab 16 -ar 16000 output.wav seems like it should do the trick (except for little endian), but when I check the output with Audacity, it still labels it as “32-bit float”. The command I found on this site also uses -acodec pcm_s16le, which from its name seems to be outputting 16 bit little endian; however, Audacity still tells me the output is 32 bit float.

Can anyone tell me how to convert audio files into the format required by CMU Sphinx 4?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:49:59+00:00Added an answer on June 15, 2026 at 9:49 am

    Did you actually try the output from ffmpeg in CMU Sphinx 4? 32-bit float is probably your default sampling format in Audacity (Edit > Preferences > Quality). I’m guessing it converts any imported file to these settings, so it may not be reporting the parameters of the actual file, but perhaps the working file in Audacity.

    Remove -ab 16. This would instruct the encoder to use 16 bits/s and ffmpeg will ignore it for pcm_s16le anyway. So your command will look like:

    ffmpeg -i input.mp3 -acodec pcm_s16le -ac 1 -ar 16000 output.wav
    

    To convert all mp3 files in a directory in Linux:

    for f in *.mp3; do ffmpeg -i "$f" -acodec pcm_s16le -ac 1 -ar 16000 "${f%.mp3}.wav"; done
    

    Or Windows:

    for /r %i in (*) do ffmpeg -i %i -acodec pcm_s16le -ac 1 -ar 16000 %i.wav
    

    In Windows Batch file:

    for /r %%i in (*.mp3) do ffmpeg -i "%%i" -acodec pcm_s16le -ac 1 -ar 16000 "%i.wav"
    

    You can see file information with file, ffmpeg, ffprobe, mediainfo among other utilities:

    $ file hjl0bC.wav 
    hjl0bC.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 16000 Hz
    
    $ ffmpeg -i hjl0bC.wav
    [...]
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to download 2.5k+ files using curl. I'm using Drupals inbuilt batch api
Is there any batch script compiler available? I have a very big batch file
I have the following use case: I need to process a big number of
I have a folder of media files that are about 1TB big. I want
I want to process a batch operation in a big directory. Actually I have
I have the following XML structure: <School> <SchoolInfo> <SchoolName>The Big School</SchoolName> <Opened>2008</Opened> <SchoolID>SCH1122</SchoolID> <Geograpics>
I have big collection of tweets stored in MongoDB. Tweets look like this one:
I have one big batch script which sets bunch of environment variables. I want
I have loop, where I'll copy all *.txt files to big.txt in the same
I'm using Windows and have a batch file (contents attached below) where I'm building

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.