diff --git a/src/filewriter.cpp b/src/filewriter.cpp
index dbb2ed1b32d69b7ad5ce41b76513f76735c17b76..6ec9057b423bec75059e5a2236239d077e71a185 100644
--- a/src/filewriter.cpp
+++ b/src/filewriter.cpp
@@ -92,7 +92,7 @@ WavFileWriter::WavFileWriter(std::string &filename_template, size_t num_channels
     // write header
     store_little_endian(header.fmt_channels, num_channels);
     store_little_endian(header.fmt_sample_rate, sample_rate);
-    store_little_endian(header.fmt_bits_per_sample, 1<<(2+depth));
+    store_little_endian(header.fmt_bits_per_sample, 8 * depth);
     store_little_endian(header.fmt_byte_rate, num_channels * sample_rate * depth);
     store_little_endian(header.fmt_frame_size, num_channels * depth);
     if (expected_num_samples) {
diff --git a/src/main.cpp b/src/main.cpp
index 7b69b06b44dd16622c11e3757e3385ada3002c0b..da1c5940861d6346001399655bbf6dacdec106ff 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -69,7 +69,7 @@ int record(size_t channels, size_t rate, size_t depth, size_t filter,  std::stri
         size_t sample_size = channels * depth;
         std::vector<std::uint8_t> samples;
         try {
-            std::cout << "Setting recording format to " << channels << " channels at " << rate << " Hz " << (1<<(2+depth)) << " bits" << std::endl;
+            std::cout << "Setting recording format to " << channels << " channels at " << rate << " Hz " << (8 * depth) << " bits" << std::endl;
             recorder.start_recording(channels, rate, depth, filter);
             // we will record until we have enough (or forever, if totallen == 0)
             while ((total_samples_wanted == 0) || (total_samples_read < total_samples_wanted)) {
diff --git a/src/recorder.cpp b/src/recorder.cpp
index b16869b96443c6fc73db347c95655d96c2d5298c..823bd69d16ead0575c3742c0e3e6b5ecb7ef9d95 100644
--- a/src/recorder.cpp
+++ b/src/recorder.cpp
@@ -122,7 +122,7 @@ void JasonRecorder::start_recording(std::uint8_t num_channels,size_t  sample_rat
             (std::uint8_t) ((sample_rate >> 8) & 0xFF),
             (std::uint8_t) (sample_rate & 0xFF),
             num_channels,
-            (std::uint8_t) ((1 << (2 + depth))),
+            (std::uint8_t) (8 * depth),
             num_filter};
     send_message(START_ID, payload1);
     this->num_channels = num_channels;
@@ -141,7 +141,7 @@ void JasonRecorder::stop_recording() {
             (std::uint8_t) ((this->sample_rate >> 8) & 0xFF),
             (std::uint8_t) (this->sample_rate & 0xFF),
             this->num_channels,
-            (std::uint8_t) ((1 << (2 + this->depth))),
+            (std::uint8_t) (8 * this->depth),
             this->num_filter};
     send_message(START_ID, payload1);
     recording = false;