Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Flac Error (Read 3225 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Flac Error

Hello!
I just tried to convert some big wav-files (25-55MB) with foobar2k into flac. But everytime this error occurs:

Code: [Select]
Error writing to file (Encoder has terminated prematurely with code 1; please re-check parameters)


If I convert e.g. a mp3-file with the same flac-preferences it works without a problem.
I use flac.exe v1.1.2 (ICL8.1 compile, "P3 and Generic") and have libmmd.dll in the foobar-folder, too.

Can anyone give a hint what to do?


Flac Error

Reply #2
Here the Info of the Files:
Code: [Select]
Sample Rate : 36000 Hz
Channels : 2
Bits Per Sample : 16
Bitrate : 1152 kbps
Codec : PCM
Encoding : lossless


If I use the flac.exe of flac.sourceforge.net the same error occurs.

Flac Error

Reply #3
You're getting this error because of 36000 Hz samplerate. Here is the detailed explanation:
Quote
test.wav: ERROR initializing encoder
          state = FLAC__STREAM_ENCODER_NOT_STREAMABLE

The encoding parameters specified do not conform to the FLAC Subset and may not
be streamable or playable in hardware devices.  Add --lax to the command-line
options to encode with these parameters.

You need to specify custom encoding parameters in foobar2000:
- go to Preferences -> Tools -> Converter
- doubleclick on FLAC entry
- in the Encoder dropdown menu change FLAC to Custom
- change the Parameters string from "-s -8 - -o %d" to "--lax -s -8 - -o %d" (add --lax option in the beginning of the string).

With the --lax option FLAC will encode 36 kHz files just fine.

 

Flac Error

Reply #4
Thank you very much! Now it works.