Log in

View Full Version : ConvertAudioToFloat output is 16 bit PCM


Ebobtron
23rd July 2006, 17:06
Hello,

While cleaning up some code in avsFilmCutter (http://forum.doom9.org/showthread.php?t=97438) I discovered the following.

When "ConvertAudioToFloat()" used in a script.

The following two methods report different things.

VideoInfo info = clip->GetVideoInfo();
(info.SampleType() == 16) or float 32

WAVEFORMATEX.wBitsPerSample == 16
WAVEFORMATEX.wFormatTag == WAVE_FORMAT_PCM

The resultant PCM output plays well in all player I have tried. I would think that a 32 bit float output would sound pretty bad if reported to a player as 16 bit. So I am assuming that the output is 16 bit PCM though I have not checked it for differences from a normal 16 bit sample of wave data.

Because WAVE_FORMAT_IEEE_FLOAT is a valid format tag, the question could be begged. What is the intended audio output when "ConvertAudioToFloat()" is used?

Or am I just confused again by what I see.

Seems I need to learn how search works.

* This version has had the automatic output ConvertAudioTo16Bit disabled
* to ease the testing of input of WAVE_FORMAT_IEEE_FLOAT type steams.
* Audio Sample type float will be output as WAVE_FORMAT_IEEE_FLOAT to
* the host application. None of the popular application can currently
* handle this stream type. Add a ConvertAudioTo16Bit() to the end of
* your script. This will be restored for the next release.


:o never mind :o

:thanks:
Ebobtron

IanB
24th July 2006, 06:41
Note! From the beta 3 release adding this global to your script will expose float output. I will probably add another similar flag to do WAVE_FORMAT_EXTENSIBLE mode output. The code is in the current CVS but is disabled.# This option enables WAVE_FORMAT_IEEE_FLOAT audio output.
# The default is to autoconvert Float audio to 16 bit.

global OPT_AllowFloatAudio=True

Ebobtron
24th July 2006, 13:58
Thanks IanB,

"global OPT_AllowFloatAudio=True" uncovers the float output.

:cool:

Copying AviSynth output stream directly seems compatible with all players, even with me using the earlier versions of the WAVEFORMAT headers. Seem that if you properly id the chunks, matters little if a chunk or two more or less are present or missing.

Now all I have to do is determine the file headers I wish to use. I can’t find two examples of IEEE Float that match. Good thing is, I can offer more than one. Do you have a preference.

One brick at a time.
:thanks:
Thanks again