Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th May 2024, 03:05   #1  |  Link
d9probe
Registered User
 
d9probe's Avatar
 
Join Date: Mar 2024
Posts: 3
Problem Flac | Sox

Quote:
Originally Posted by Barough View Post
SoX Binary v14.4.2 (2024-05-23)
https://www.mediafire.com/file/gr2gh8xoh6fc3es
flac -d --force-legacy-wave-format -c src.flac | sox -V3 --ignore-length -t wav - -b16 -c2 -r44.1k out.wav


sox: SoX v14.4.2
sox FAIL formats: can't open input `-': invalid chunk ID found
f.flac: ERROR, decoded number of samples is smaller than the total number of samples set in the STREAMINFO

Last edited by tebasuna51; 24th May 2024 at 11:48.
d9probe is offline   Reply With Quote
Old 24th May 2024, 06:47   #2  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,846
Barough only compiled and provided binaries for download. And this is not a thread to discuss issues. I would recommend to discuss your problem in a separate thread in an audio related category, and we would need a lot more information about your source file, possibly even a copy, to confirm it in the first place. I could imagine that this might only happen with a specific combination of channel layout and sample formats...
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 24th May 2024, 12:23   #3  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,982
It is not a sox problem but flac STDOUT output, I can reproduce the problem with any flac input file.

By the moment you need to do it in two steps:

flac -d -o src.wav -c src.flac
sox -V3 --ignore-length -t wav src.wav -b16 -c2 -r44.1k out.wav

Or use ffmpeg with sox resampler also:

ffmpeg -i src.flac -af aresample=44100:resampler=soxr out.wav
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 24th May 2024, 12:54   #4  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,846
Thank your for splitting the thread.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 25th May 2024, 11:31   #5  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,982
I found than sox accept wav files with RF64 headers then the recommended two pass method to support big files must be:

Code:
flac -d --force-rf64-format -o rf64.wav src.flac
src.flac: done

sox -V6 rf64.wav -b16 -c2 -r44.1k out.wav
sox:      SoX v14.4.2
time:     May 23 2024 21:40:13
compiler: gcc 14.1.0
arch:     1248 48 88 L OMP
sox INFO formats: detected file format type `wav'
sox DBUG wav: Found RF64 header
sox DBUG wav: Found chunk 'ds64', size 28
sox DBUG wav: Found chunk 'fmt ', size 16
sox DBUG wav: Found chunk 'data', size 4294967295

Input File     : 'rf64.wav'
Channels       : 2
Sample Rate    : 48000
Precision      : 16-bit
Duration       : 00:00:20.00 = 960000 samples ~ 1500 CDDA sectors
File Size      : 3.84M
Bit Rate       : 1.54M
Sample Encoding: 16-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no

sox DBUG wav: Writing Wave file: PCM format, 2 channels, 44100 samp/sec
sox DBUG wav:         176400 byte/sec, 4 block align, 16 bits/samp

Output File    : 'out.wav'
Channels       : 2
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:00:20.00 = 882000 samples = 1500 CDDA sectors
Sample Encoding: 16-bit Signed Integer PCM
Endian Type    : little
...
sox DBUG wav: Finished writing Wave file, 3528000 data bytes 882000 samples
We don't need the --ignore-length parameter for sox
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 25th May 2024, 13:48   #6  |  Link
d9probe
Registered User
 
d9probe's Avatar
 
Join Date: Mar 2024
Posts: 3
The same error can also be reproduced on files such as APE music
The problem is not with the flac program.
Maybe the music files are not standardized.
But the most important problem is the sox program.
The 32-bit version provided on the SF website works properly.
https://sourceforge.net/projects/sox/files/sox/14.4.2/
Maybe some patches introduced after the SF stable version caused the bug.
But I don't know what happened exactly.

Last edited by d9probe; 25th May 2024 at 13:50.
d9probe is offline   Reply With Quote
Old 25th May 2024, 23:12   #7  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,982
You are right that old (2015) 32 bits version work fine:

Code:
flac -d --force-rf64-format -c src.flac | sox -V6 -t wav - -b16 -c2 -r44.1k out8.wav

flac git-cfe3afca 20240516...

sox:      SoX v14.4.2
time:     Feb 22 2015 15:05:01
compiler: gcc 4.9.2 20141030 (Fedora MinGW 4.9.2-1.fc21)
arch:     1248 48 44 L OMP
sox DBUG wav: Searching for 64 73 36 34
sox DBUG wav: WAV Chunk ds64
sox DBUG wav: Found ds64 header
sox DBUG wav: Searching for 66 6d 74 20
sox DBUG wav: WAV Chunk fmt
sox DBUG wav: Searching for 64 61 74 61
sox DBUG wav: WAV Chunk data
sox DBUG wav: Reading Wave file: Microsoft PCM format, 2 channels, 48000 samp/sec
sox DBUG wav:         192000 byte/sec, 4 block align, 16 bits/samp, 3840000 data bytes
sox DBUG wav:         960000 Samps/chans
...
src.flac: done
sox DBUG wav: Finished writing Wave file, 3528000 data bytes 882000 samples
Seems something related with the 'pipe' data transmisions.
The new versions also FAIL when 'pipe' from eac3to, tested longtime ago successfully.
Tested last 32 and 64 bits sox versions.

Quote:
eac3to.exe src.flac stdout.wav -simple | sox.exe -V6 -t wav - -b16 -c2 -r44.1k src.flac_.wav
SoX v14.4.2
time: May 23 2024 21:10:30
compiler: gcc 14.1.0
arch: 1248 48 44 L OMP
C:\Portable\eac3to\UsEac3to\sox.exe DBUG wav: Found chunk 'fmt ', size 16
C:\Portable\eac3to\UsEac3to\sox.exe FAIL formats: can't open input `-': invalid chunk ID found
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 25th May 2024 at 23:49.
tebasuna51 is offline   Reply With Quote
Old 26th May 2024, 16:25   #8  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,982
Waiting to sources used for Barough to build the SoX Binary v14.4.2 (2024-05-23) and the changelog than improve the official v14.4.2 from 2015 I found some binaries v14.4.2 2017 and also a v14.4.3 from 2020.

Both of them work fine with the flac/eac3to 'pipe'.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 27th May 2024, 08:58   #9  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,982
Open https://sourceforge.net/p/sox/bugs/375/
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 27th May 2024, 10:58   #10  |  Link
d9probe
Registered User
 
d9probe's Avatar
 
Join Date: Mar 2024
Posts: 3
Quote:
Originally Posted by tebasuna51 View Post
Thank you!
Hope there will be a good result...
d9probe is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:39.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.