Close Menu
    X (Twitter)
    Hectic GeekHectic Geek
    • Apps
      • Apps for Mac
      • Apps for PCs
      • Best Apps
    • Concepts
      • Comparison
      • For Geeks
      • IT Careers
    • Gadgets
      • Accessories
      • Best Work Laptops
      • Budget Laptops
    • GNU/Linux
      • Ubuntu
    • How To
      • Virtualization
      • Windows
      • Windows How-To
    Hectic GeekHectic Geek
    Home » One way to Fix WAV file’s ‘Header’ Related errors in Ubuntu Linux
    Ubuntu

    One way to Fix WAV file’s ‘Header’ Related errors in Ubuntu Linux

    GayanBy GayanJune 12, 2012Updated:October 4, 2012No Comments3 Mins Read
    Twitter Reddit Telegram WhatsApp Email
    Share
    Twitter Reddit Telegram WhatsApp Email

    Whenever I save the recorded audio files into the ‘WAV’ format using the audio recording tool in Ubuntu, though most players play them without any issues, but, when trying to load them into an audio editor or trying to convert them for instance, some tools give me the following error and exit:

    ‘premature end of file “your-audio-file.wav” while reading audio data’

    This is usually caused by incomplete or somewhat a ‘corrupted’ WAV file ‘header’ (a special part of a WAV file that contains information such as its length, the codec that should be used for decoding, bitrate etc). These tools won’t be able to fix all sorts of errors, but ‘qwavheaderdump’ and ‘qwavinfo’ can fix some of these errors.

    They can inspect a WAV file and if it finds errors, then will display the actual error rather than giving the above ‘premature end …’ message as it doesn’t say a lot about what’s the actual cause for that corruption.

    ‘qwavheaderdump’ and ‘qwavinfo ‘ are a part of the package called ‘quelcom’ (a set of tools that lets you fix/edit MP3 and WAV files). But I’ll be concentrating on those two tools here.

    You can install them in Ubuntu 12.10 Quantal Quetzal, 12.04 Precise Pangolin, 11.10 Oneiric Ocelot, 11.04, 10.10 and 10.04 by entering the below command in your Terminal window.

    sudo apt-get install quelcom

    How to use them?

    To scan a file for errors I’ll use the below tool/command …

    qwavinfo your-audio.wav

    Simply replace ‘your-audio.wav’ with your file’s path and name. At the end, it’ll scan and display the actual cause behind the error.

    To try and fix a file, I’ll use the below command …

    qwavheaderdump -F your-audio.wav

    Don’t change the ‘-F’ argument, but again, make sure to replace the file name and the path. As soon as you run this command, it’ll scan and fix the file (if possible) and display a report.

    An example …

    For ease of understanding, let me give you an example.

    Let’s assume that I have a troublesome WAV file called ‘demo.wav in my ‘Home’ folder. Then first I’ll use the below command to scan it for errors.

    qwavheaderdump demo.wav

    And as you can see from the first screenshot, it gave me an error by saying that the actual cause behind that ‘premature end …’ error is a ‘length mismatch’ issue.

    To fix it, I’ll use the below command (you actually can simply skip scanning for errors and use the below command straight away as well).

    qwavheaderdump -F demo.wav

    As soon as I do this, it fixed this ‘length mismatch’ error, which is found in almost all WAV files created using the audio record tool in Ubuntu.

    That’s it. Enjoy!.

    Share. Twitter Reddit Telegram WhatsApp Email
    Gayan

    An RHCE, 'Linux' user with 14+ years of experience. Extreme lover of Linux and FOSS. He is passionate to test every Linux distribution & compare with the previous release to write in-depth articles to help the FOSS community.

    Related Posts

    How to Check Linux CPU Usage?

    February 5, 2024

    Linux export Command: A Comprehensive Tutorial

    February 3, 2024

    Debian vs Ubuntu Server: A Brief Comparison for Beginners

    July 2, 2023

    CPU Based Simple System Stability and Benchmark Tester for Ubuntu Linux – systester

    June 16, 2023

    Typespeed: Typing Speed Testing Game for Ubuntu Linux

    March 12, 2023

    Debian vs Ubuntu in 2023- Which Linux OS is Right for You?

    January 6, 2023
    Leave A Reply Cancel Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Latest Posts

    Transforming Geek Culture with Advanced Software Development

    April 8, 2024

    The Role of Technology in Enhancing Digital Signage Solutions

    February 21, 2024

    How to Check Linux CPU Usage?

    February 5, 2024

    Linux export Command: A Comprehensive Tutorial

    February 3, 2024

    [Fixed] HDMI No Signal to TV or Monitor on Windows 10/11

    November 7, 2023

    AlmaLinux vs Ubuntu – How to Select the Best One?

    October 22, 2023

    Subscribe to Updates

    Get the latest news and updates from Hectic Geek. We won't overload you or sell your data!

    Contact
    • About Us
    • Contact Us
    • Privacy Policy
    • Write for Us
    X (Twitter)
    © 2026 Hectic Geek.

    Type above and press Enter to search. Press Esc to cancel.