Log in

View Full Version : Opening 24 bit 48 KHz mono WAVs in AviSynth


Blue_MiSfit
24th February 2009, 01:29
Hi all,

Does WAVSource support 24 bit, 48 KHz mono WAVs properly? I get an error message when I try to load said files. My ultimate goal is to use AviSynth to assemble a 5.1ch track, apply an audio delay, and use SoundOut to generate a Dolby Digital audio stream.

For now, my workaround has been to generate a 640kbps AC3, load that with NicAC3Source, apply the delay, and do the final encode at 384kbps. But as we all know this is lossy... and loss makes me a sad misfit :(

Here's the error message..

No compatible ACM codec to decode 0xFFFE audio stream to PCM


eac3to reports the following about the WAVs:

WAV, 0/1 channels, 1:25:59, 24 bits, 1152kbps, 48khz


EncWAVtoAC3 reports them as Microsoft WAVE, 24 bit, signed, little-endian, 48KHz, mono.

Any ideas?

~MiSfit

tebasuna51
24th February 2009, 02:38
The 0xFFFE audioformat is from a WAVE_FORMAT_EXTENSIBLE header not supported by AviSynth until 2.5.8.

If you don't want change to AviSynth 2.5.8, and you have NicAudio.dll, you can open the wav file with RaWavSource() instead with the standard WavSource()

Edit: RaWavSource() is still needed to open wav files > 4GB

Blue_MiSfit
24th February 2009, 03:58
Ah-HAH! I should have guessed.

Thanks as always for your help tebasuna51!

I do infact have nicaudio, and need to stick with 2.5.7 for the time being.

Awesome :)

~MiSfit

Blue_MiSfit
24th February 2009, 04:04
Worked perfectly.

I had to specify the number of channels, and strangely when I specified 24 bit / 48KHz I got white noise output.

For example

RaWAVSource("file.wav", 48000,24,1)

produced pure static

whereas
RaWAVSource("file.wav",1)

worked fine.

Strange :)

Oh well, it works :D

~MiSfit

tebasuna51
24th February 2009, 12:12
"SampleRate" Necessary for lpcm and raw files. In RaWavSource a value < 9 means a header with valid
values for SampleRate/SampleBits/Channels and now means:
IgnoreLength 1 force ignore the data size read in the header also in 64 bits formats.
2 ignore the data size 32 bits read in the header if > 2GB. (default)
4 ignore the data size 32 bits read in the header if > 4GB.

If you put a value greater than 8 in first parameter the data is considered RAW (without header) and the header is considered as audio data missing the correct channels alignment with garbage output.

With 1 the data size in header is ignored always, but some audio editors can put extrachunks at end of file and now are considered as audio data with clicks at end.

Don't put parameters is the best option. Only files with possible corrupt header have the data size ignored.