Author Topic: Converting 24 bit wav file to flac changed it into 16 bit  (Read 5303 times)

SpaceKeeper025

  • Newbie
  • *
  • Posts: 13
I used libFLAC 1.3.2 to convert a 24 bit wav to flac (Standard compression, lossyWAV not enabled, no volume adjustment) in musicbee (Latest version on Microsoft Store) but the bit depth was changed to 16 bit, its sample rate remained 96 kHz. This doesn't happen when I convert from flac to flac. Please fix it soon

sveakul

  • Hero Member
  • *****
  • Posts: 2033
Are you using the latest patched version of MusicBee (3.3.7038 as of this moment)?  There has been a fix for a WAV to AIFF issue that may be related to yours.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8161
I may be mistaken, but I don't think you can patch Store versions of MB. Please correct me if I'm wrong.

While the Store version offers the advantage of automatic updates, the updates are far, far behind the Installer and the Portable versions. Unless you're able to patch it.
Download the latest MusicBee v3.5 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.

sveakul

  • Hero Member
  • *****
  • Posts: 2033
phred, I stand corrected--missed that the OP said he's using the Store version.  AFAIK that one has never been able to be patched (?).  IMO the main utility of the Windows Store version lies in being able to give Windows 10 users a quick-and-easy way to give MusicBee a try, and then move to the continually updated versions once they acquire the taste.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8161
IMO the main utility of the Windows Store version lies in being able to give Windows 10 users a quick-and-easy way to give MusicBee a try, and then move to the continually updated versions once they acquire the taste.
Not to hijack this thread, but if a user want's a quick and easy way to try MB, the portable version is the way to go. Simpler to 'install' and no issues with user permissions.
Download the latest MusicBee v3.5 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.

huoc

  • Newbie
  • *
  • Posts: 6
Hi!
I am using 3.3.7491 Store version and have encountered the same issue as the OP. Converting a 96/24 wav gave a 96/16 flac result. I did not find a way to fix this. I would appreciate any help.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8161
Get rid of the Store version and use the Portable. Be sure to place in a directory that is -not- Windows controlled. Create a new folder called MusicBee and place it at the root of one of your drives.
Download the latest MusicBee v3.5 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.

Zak

  • Member
  • Hero Member
  • *****
  • Posts: 2215
I don't think you'll be able to do this in MusicBee "out of the box".
The flac.exe converter that MusicBee uses keeps the same bit depth as the input file by default.
This makes me think the bith depth is being reduced before it is passed to the encoder, so no additional tweaking will fix that.

If you use flac.exe from the command line it will work.
Bee excellent to each other...

sveakul

  • Hero Member
  • *****
  • Posts: 2033
Confirmed here with 3.4.7514.  The bit depth reduction looks like it's being caused by libFLAC.dll, which is included in MusicBee's main directory.  That file is called every time a conversion using flac.exe is done using MusicBee, as renaming the dll will result in no conversion and an error about MusicBee being unable to find libFLAC.dll.

The question is why flac.exe isn't being used "on its own", which as Zak indicates would result in a 24-bit conversion to match the source.  Maybe Steven can supply us with info on why libFLAC.dll is being used during this process.
Last Edit: July 29, 2020, 03:57:51 AM by sveakul

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 33456
libFlac is used when storing file tags, not in the conversion itself.
FLAC.exe is used the format conversion

Bee-liever

  • Member
  • Hero Member
  • *****
  • Posts: 3776
  • MB Version: 3.5.8367 P
@ huoc  Check your .wav files are 24-bit PCM files.  If they are 32-bit PCM or 32-bit float then FLAC conversion automatically defaults to 16 bit.
MusicBee and my library - Making bee-utiful music together

sveakul

  • Hero Member
  • *****
  • Posts: 2033
The test I made was with a 24-bit PCM 96khz wav:



Using the flac.exe supplied in the MusicBee/Codec folder, I did a command line conversion of the wav to flac using the stock options supplied in the MB configuration.xml file:   C:\MusicBee\Codec>flac -s -5 -o 24-96.flac 24-96.wav .  This resulted in a 24-bit FLAC as shown below:



I then repeated the operation with the original wav added to my library, and this time within the MusicBee File Converter GUI with the same options set (resample is NOT checked):



But this results in a 16-bit FLAC:



So the question is, what exactly could MusicBee be doing that is disallowing a 24-bit wav to 24-bit FLAC conversion when attempted through its GUI?

huoc

  • Newbie
  • *
  • Posts: 6
I did some testing as well.

original wav file (for reference it was downloaded from here: https://www.nilsfrahm.com/works/sol/ )
Size 33,84 MB  (0% Compressed)
Original Size 33,84 MB
Length 1 minute 1 second
Channels 2  (stereo)
Sample Rate 96 KHz;
Sample Size 24 bit
Bit Rate 4 608 kbps  (DVD)
Encoder
Encoder Settings PCM
Audio Quality DVD  (Lossless)
Contains ID Tag [list & ID3]
Channel Mapping Left, Right
Type WAV Audio File    [.wav]

converting in a command line "flac -s -8 -o d:\test.flac d:\test.wav" gives two warnings:
test.wav: WARNING: skipping unknown chunk 'JUNK' (use --keep-foreign-metadata to keep)
test.wav: WARNING: legacy WAVE file has format type 1 but bits-per-sample=24

however, it still completes the conversion and results in this:
Size 19,47 MB  (43% Compressed)
Original Size 33,84 MB
Length 1 minute 1 second
Channels 2  (stereo)
Sample Rate 96 KHz;
Sample Size 24 bit
Bit Rate 4 608 kbps  (DVD)
Encoder FLAC reference libFLAC 1.3.2 20170101
Encoder Settings
Audio Quality Perfect (Lossless)
Contains CRC
Channel Mapping
Type FLAC Audio File    [.flac]

Converting in musicbee results in this:
Size 8,26 MB  (64% Compressed)
Original Size 22,56 MB
Length 1 minute 1 second
Channels 2  (stereo)
Sample Rate 96 KHz;
Sample Size 16 bit
Bit Rate 3 072 kbps  (DVD)
Encoder FLAC reference libFLAC 1.3.2 20170101
Encoder Settings
Audio Quality Perfect (Lossless)
Contains CRC, ID Tag [Vorbis Comments]
Channel Mapping
Type FLAC Audio File    [.flac]

What I note here without deep (as a matter of fact - any) knowledge on the subject is that if the file was being converted with musicbee, 'file properties' reports the original file size incorrectly (22,56 MB versus the real 33,84 MB which is exactly the ratio of 16:24)[/list]

Bee-liever

  • Member
  • Hero Member
  • *****
  • Posts: 3776
  • MB Version: 3.5.8367 P
MB is not recognising the files as 24 bit.
Look in the tag editor> Properties tab> type: and it shows Wave audio file
when it should show Wave audio file, 24 bit.

Adding --force-raw-format --bps=24 to the beginning of the encoding parameters should force 24 bit output, but unfortunately MB only produces an error with these settings
MusicBee and my library - Making bee-utiful music together

sveakul

  • Hero Member
  • *****
  • Posts: 2033
The "kicker" for me is that even if MusicBee can't identify the wav as 24-bit, if it's actually sending the original file to flac.exe for the conversion then how is it ending up being changed to 16-bit for the result?  It's almost like MB is doing some kind of conversion of its own before the file goes to flac.exe's hands, or applying some other option not actually in the parameters box.