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. |
8th April 2007, 16:35 | #1 | Link |
Testeur de codecs
Join Date: May 2003
Location: France
Posts: 2,484
|
AVS to WAV
How to convert avs audio files to wav ... ???
I try BePipe but there are win32 error ...
__________________
Le Sagittaire ... ;-) 1- Ateme AVC or x264 2- VP7 or RV10 only for anime 3- XviD, DivX or WMV9 |
8th April 2007, 16:51 | #2 | Link |
HDConvertToX author
Join Date: Nov 2003
Location: Cesena,Italy
Posts: 6,552
|
SoundOut
http://forum.doom9.org/showthread.php?t=120025 like this Code:
LoadPlugin("NicAudio.dll") LoadPlugin("SoundOut.dll") NicAC3Source("fixed1.ac3") #Applying STEREO downmixing routines function stereo(clip a) { flr = GetChannel(a, 1, 2) fcc = GetChannel(a, 3) lfe = GetChannel(a, 4) lfc = MixAudio(fcc, lfe, 0.2071, 0.2071) mix = MergeChannels(lfc, lfc) lrc = MixAudio(flr, mix, 0.2929, 1.0) blr = GetChannel(a, 5, 6) Return MixAudio(lrc, blr, 1.0, 0.2929) } # 6==Audiochannels() ? stereo() : last Normalize() Soundout(output="wav",type=0,autoclose=true,filename="audio.wav",showoutput=false)
__________________
HDConvertToX: your tool for BD backup MultiX264: The quick gui for x264 AutoMen: The Mencoder GUI AutoWebM: supporting WebM/VP8 |
10th April 2007, 23:56 | #4 | Link |
Registered User
Join Date: Apr 2003
Location: Brazil
Posts: 247
|
or a command line avs2wav
http://home.pages.at/kassandro/avs2wav.rar |
23rd June 2007, 11:59 | #7 | Link |
Registered User
Join Date: Jun 2007
Location: Budapest
Posts: 44
|
Hello,
I also wrote a small command line utility for that purpose a while ago (just to try out how such stuff works), now I uploaded it to SF so you can get it from there: http://sourceforge.net/projects/wavi-avi2wav :alvarez: |
24th June 2007, 01:38 | #8 | Link | |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Quote:
Don't work with SoundOut (like Bepipe) but the STDOUT can be piped to encoders and obtain the finals ac3, aac, ... without intermediate wav files. I'm very interested in Wavi but, like bepipe, have two problems with easy solution: 1) The wav header have a little bug, in wavi.c line 162: *(LPDWORD)(wavHeader + headerPos) = (DWORD) fileSize + 8; must be: *(LPDWORD)(wavHeader + headerPos) = (DWORD) fileSize; 2) There are extra bytes written at end of file, then the RiffLength (well calculated) seems erroneous and some software can reject the wav files. Maybe we can test something like (in wavi.c, line 200): Code:
while (nextSample < streamInfo.dwLength) { if (userBreak) CleanupAndExit(1); bytesToWrite = 0; if (AVIStreamRead(aviStream, nextSample, samplesInBuffer, buffer, bufferSize, & bytesToWrite, & samplesRead) || (! bytesToWrite)) { fprintf(stderr, "Error: Could not read audio data from \"%s\".\n", inputFile); if (! toStdOut) CloseHandle(outputHandle); CleanupAndExit(1); } nextSample += samplesRead; // moved // New line: if (nextSample > streamInfo.dwLength) bytesToWrite = bytesToWrite - sampleSize * (nextSample - streamInfo.dwLength); if (! WriteFile(outputHandle, buffer, bytesToWrite, & bytesWritten, NULL) || (bytesWritten != bytesToWrite)) { if (toStdOut) { fprintf(stderr, "Error: Could not write to the standard output.\n"); } else { fprintf(stderr, "Error: Could not write file \"%s\".\n", outputFile); CloseHandle(outputHandle); } CleanupAndExit(1); } // nextSample += samplesRead; } EDIT: Seems work fine with these corrections. Last edited by tebasuna51; 24th June 2007 at 12:17. |
|
24th June 2007, 14:29 | #9 | Link | |||
Registered User
Join Date: Jun 2007
Location: Budapest
Posts: 44
|
Hello,
Thanks for testing WAVI out! It seems that instead of only trying it with Winamp and Aften I sould've taken a deeper look... Quote:
Quote:
Quote:
Code:
while (nextSample < streamInfo.dwLength) { if (userBreak) CleanupAndExit(1); if (streamInfo.dwLength - nextSample < samplesInBuffer) { bufferSize = (streamInfo.dwLength - nextSample) * sampleSize; } http://sourceforge.net/projects/wavi-avi2wav Thanks again! :alvarez: |
|||
24th June 2007, 15:54 | #10 | Link | ||
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Quote:
Quote:
@Sagittaire and everybody, please check Wavi to replace Bepipe usage (avs2wav never work for me) because can be: - More compatible (without .NET Framework dependence) - Free of bug in wav header and extra bytes at end. BTW, to use Avisynth SoundOut plugin, I recommend use: avs2avi test.avs -c null -q -e With these parameters only the SoundOut GUI (if required) is open and we avoid problems or close other interfaces like VirtualDub, mplayer, .... |
||
24th June 2007, 21:48 | #11 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
@alvarez
One more thing. With AviSynth v2.5.7 if you use in avs's: global OPT_AllowFloatAudio=True the output can be with 32 bits float samples, Wavi can support without problems these wav files with: #define WAVE_FORMAT_IEEE_FLOAT 3 and changing line 100 from wavi.c: Code:
// if (waveFormat.wFormatTag == WAVE_FORMAT_PCM ) { if (waveFormat.wFormatTag == WAVE_FORMAT_PCM || waveFormat.wFormatTag == WAVE_FORMAT_IEEE_FLOAT ) { Last edited by tebasuna51; 24th June 2007 at 22:08. |
26th June 2007, 12:54 | #12 | Link |
Registered User
Join Date: Jun 2007
Location: Budapest
Posts: 44
|
I've put support fot floating-point WAVs in.
Available here: http://sourceforge.net/projects/wavi-avi2wav Any other ideas? :alvarez: |
3rd July 2007, 03:49 | #13 | Link |
Registered User
Join Date: Mar 2007
Posts: 2
|
Exactly A few days ago I had just met this problem, I search a lot of software Audio Converters final trial found that the software required to complete the function. Want to help you.
AVS Audio Tools 5.4 Record audio, burn, rip and exact-copy audio and mp3 CDs, mix your own music, create and upload your own ringbones, record iRadio, convert audio.http://www.qweas.com/download/audio_...udio_tools.htm |
11th August 2007, 00:55 | #14 | Link | |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Quote:
Trying use wavi with new versions of Flac encoder I get this error message: ERROR: WAVE has >2 channels but is not WAVE_FORMAT_EXTENSIBLE; cannot assign channels Then I made a mod to wavi to output WAVE_FORMAT_EXTENSIBLE, but still don't work with flac. Now is a flac problem, works fine with WAVE_FORMAT_EXTENSIBLE files but don't read the header through STDIN: WARNING: skipping unknown sub-chunk ' ' ... The last option is send the data in RAW format, without headers, like the BeHappy method. With raw data work fine and I want offer you these options. Code:
Usage: WAVI <avi|avs-file> [ <wav-file> [ -r | -m [ <mask-chan> ] ] ] Where: <wav-file> Or '-' for STDOUT -r raw output (without header) -m WAVE_FORMAT_EXTENSIBLE header with default ChannelMask: Mask Chan. MS channels Description ---- ----- ------------------------- ---------------- 4 1 FC Mono 3 2 FL FR Stereo 259 3 FL FR BC First Surround 51 4 FL FR BL BR Quadro 55 5 FL FR FC BL BR like Dpl II (without LFE) 63 6 FL FR FC LF BL BR Standard Surround 319 7 FL FR FC LF BL BR BC With back center 255 8 FL FR FC LF BL BR FLC FRC With front center left/right Others values: 7 3 FL FR FC 263 4 FL FR FC BC like Dpl I 271 5 FL FR FC BC LF 59 5 FL FR BL BR LF Examples: wavi 4-chan-input.avs - -m 263 | aften - output.ac3 wavi surround.avs - -r | flac --force-raw-format --endian=little --sign=signed --channels=6 --bps=16 --sample-rate=48000 - output.flac Thanks. |
|
12th August 2007, 21:32 | #16 | Link | |
Registered User
Join Date: Jun 2007
Location: Budapest
Posts: 44
|
Hello,
Quote:
Thanks for your neverending support! Have a nice day, :alvarez: |
|
13th August 2007, 01:26 | #17 | Link | |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Quote:
With a simple test, copy a wav file through AviSynth, I get this times: Bepipe 1:37.73 wavi104 2:22.05 wavi105 1:34.65 |
|
16th August 2007, 13:30 | #18 | Link |
Registered User
Join Date: Jun 2007
Location: Budapest
Posts: 44
|
@tebasuna51:
Here is the merged version of wavi, which contains WAVE_FORMAT_EXTENDED support: deleted the link, see 2 posts below for the new version Could you please do a little test to see whether it works well with your Flac stuff before I publish it? Thanks, Last edited by alvarez; 16th August 2007 at 20:36. Reason: deleted the link, see 2 posts below for the new version |
16th August 2007, 18:49 | #19 | Link | |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Quote:
Code:
... // *(LPWORD)(wavHeader + headerPos) = waveFormat.wFormatTag; // must be (1) *(LPWORD)(wavHeader + headerPos) = (wavexOutput ? 0xFFFE : waveFormat.wFormatTag); ... if (wavexOutput) { *(LPWORD)(wavHeader + headerPos) = 22; headerPos += 2; *(LPWORD)(wavHeader + headerPos) = waveFormat.wBitsPerSample; // (2) headerPos += 2; *(LPDWORD)(wavHeader + headerPos) = channelMask; headerPos += 4; *(LPWORD)(wavHeader + headerPos) = waveFormat.wFormatTag; // (3) ... The values written after (3) are only valid for PCM int/float, the only possible AviSynth output. (2) Really this field is ValidBitsPerSample, but for all possible AviSynth output can be replaced safely by BitsPerSample - Not important, but maybe if you want a generic default for channelMask, instead a invalid value: Code:
if (wavexOutput && (channelMask == 0xFFFFFFFF)) { if (waveFormat.nChannels < DEFAULT_MASK_COUNT) { channelMask = DEFAULT_MASK[waveFormat.nChannels]; } else { // channelMask = 0; channelMask = (2^waveFormat.nChannels) - 1; } } |
|
16th August 2007, 20:34 | #20 | Link | |
Registered User
Join Date: Jun 2007
Location: Budapest
Posts: 44
|
Quote:
I've included your fixes, and the new version is available at: http://sourceforge.net/projects/wavi-avi2wav/ Thanks for testing & fixing! |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|