# \[SOLVED\] Recorded WAV file has weird bits per sample in the format chunk

**URL:** <https://forum.juce.com/t/solved-recorded-wav-file-has-weird-bits-per-sample-in-the-format-chunk/64085>\
**Category:** General JUCE discussion\
**Created:** [November 4, 2024, 7:01pm UTC](https://forum.juce.com/t/solved-recorded-wav-file-has-weird-bits-per-sample-in-the-format-chunk/64085 "2024-11-04T19:01:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjokipii](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@mjokipii](https://forum.juce.com/u/mjokipii)\
**Post date:** [November 4, 2024, 7:01pm UTC](https://forum.juce.com/t/solved-recorded-wav-file-has-weird-bits-per-sample-in-the-format-chunk/64085/1 "2024-11-04T19:01:57Z")

</div>

I’ve had reports of recorded audio not working on several occasions.

The app (JUCE 7.0.7) is configured to record 44.1kHz 24bit WAV. Sometimes, for no apparent reason, the recorded audio file is unreadable. I debugged the offending audio file and WavAudioFormatReader fails when the bits per sample is 56. The value is obviously wrong.

What could cause JUCE to produce a WAV file with such, most likely erroneous, format? Is this a JUCE bug or could a possibly buggy audio hardware or driver cause something like this?

WaveLab had no problems opening and playing the file and it seems the problem is only on this bits per sample value, which is obviously incorrect, and the reader just fails with any value between 32 and 64.

What would be the best way to try and tackle this?

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [November 5, 2024, 12:12pm UTC](https://forum.juce.com/t/solved-recorded-wav-file-has-weird-bits-per-sample-in-the-format-chunk/64085/2 "2024-11-05T12:12:19Z")

</div>

On what platform are you writing the WAV file, and how are you writing it? Are you definitely using the JUCE WavAudioFormatWriter as opposed to a platform-specific writer? Are you calling `replaceMetadataInFile` anywhere?

---

<div class="post-metadata">

**Author:** ![mjokipii](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@mjokipii](https://forum.juce.com/u/mjokipii)\
**Post date:** [November 5, 2024, 6:36pm UTC](https://forum.juce.com/t/solved-recorded-wav-file-has-weird-bits-per-sample-in-the-format-chunk/64085/3 "2024-11-05T18:36:00Z")

</div>

Doh… false alert. The WAV file is fine and a hex-editor shows that the bitsPerSample value is actually correct. My mistake. Sorry for the trouble.
