View Full Version : Convert aac to wav to ??? to ac3


Paulcat
9th February 2005, 19:58
I have a matroska file with 5.1 aac audio. I would like to end up with 5.1 ac3 audio.

I can use faad2 to extract the audio into a wav file, and it gives me the option to go to stereo or not.

If NOT, I get a big wav file. So how do I convert this wav file to 6 mono waves to dump into soft encode to get my 5.1 ac3?

Kurtnoise
9th February 2005, 20:06
with BeSweet....and accessory BeLight. :p You can choose the "16 bits (six) mono waves" option in WAV tab.

Sakuya
22nd February 2005, 01:31
Can I please have more information on how to do this? From what I understand, Paulcat wants to convert AAC 5.1 to AC3 5.1?

Well I have the same problem. I have HE-AAC 5.1 and I want it in AC3 5.1 so that it'll go nicely onto a DVD-R. But my authoring programs don't support AAC. How can I go about doing this?

KpeX
22nd February 2005, 05:00
Please read the AAC and AC3 sections of the FAQ, and use the search. You'll need to decode the AAC and then encode to AC3. There are numerous tools for both tasks.

Sakuya
22nd February 2005, 05:09
I used faad2 to decode the AAC to a 6ch WAV. Then I used BeSplit command line to split that WAV into 6 mono WAVs using this:

besplit -core( -input multichannel.wav -prefix mono -demux -type wav )

I have Soft Encode. How do I know what order it is in? In Soft Encode, I opened all the WAVs in order, as raw data. There's an option menu after that for each WAV so I chose: 1 channel (since they're in mono individually) and then 44100Hz (source samp. rate)
I set the order as the WAV channel order which is I believe: L,R,C,LFE,SL,SR. I noticed that there's a clip sound at the very beginning when I play it in Soft Encode. But I don't get that clip when I play it in Winamp.

Edit:
My problem lies in the video portion and is making it all go out of sync. Should I start a new thread or stay here? :(

violao
23rd February 2005, 12:17
Originally posted by Sakuya
... and then 44100Hz (source samp. rate)
If you want to create DVD you need to resample your audio to 48000.

Sakuya
23rd February 2005, 19:59
I've already gotten the audio out of the way. I inputted that AC3 into BeSweet and changed the sampling rate (preserving 5.1). Does BeSweet mess up the channel order? I'm not sure. I can't check yet because my DVD project is out of sync.

My problem lies in the MKV>AVI video but since this is in the Audio forum, I'm not sure if I should post here or start a new thread.

Sakuya
24th February 2005, 07:00
One question on AAC. How does HE-AAC 5.1 lose quality when transcoded from AC3 5.1? Does the volume get distorted? I tested my AC3 and it all sounds pretty good. I don't think I even need the increase LFE. So what did the AAC FAQ mean by "quality"?

Paulcat
24th February 2005, 14:00
I know this answer is available somewhere else but, since it follows this thread...

Starting with the multichannel wav files, if it is in two parts, how can I merge the two BEFORE processing?

Paulcat
25th February 2005, 01:30
Originally posted by Sakuya
I used faad2 to decode the AAC to a 6ch WAV. Then I used BeSplit command line to split that WAV into 6 mono WAVs using this:

besplit -core( -input multichannel.wav -prefix mono -demux -type wav )

I have Soft Encode. How do I know what order it is in? In Soft Encode, I opened all the WAVs in order, as raw data. There's an option menu after that for each WAV so I chose: 1 channel (since they're in mono individually) and then 44100Hz (source samp. rate)
I set the order as the WAV channel order which is I believe: L,R,C,LFE,SL,SR. I noticed that there's a clip sound at the very beginning when I play it in Soft Encode. But I don't get that clip when I play it in Winamp.

I did the same. According to the note that pops up in faad2, the channel order is "reset to" C,L,R,SL,SR,LFE. In reality, the order remains as you stated (L,R,C,LFE,SL,SR). When entering the waves into soft encode, it expects them in the order L,C,R,SL,SR,LFE so you have to make sure the correct wav goes to the matching channel.

Soft encode will also let you output to 48000Hz so you can skip your last step.

Sakuya
25th February 2005, 04:05
So what you're saying is that BeSplit outputs the mono WAVs in this order (L,R,C,LFE,SL,SR) but Soft Encode needs each WAV to go in this order (L,C,R,SL,SR,LFE).

I find in Soft Encode that you can change the speaker settings of each WAV by clicking one of the other speakers. Can I do that or must I need to open them all in the default order (L,C,R,SL,SR,LFE)?

Also, I opened each mono WAV as raw data as 44100Hz. It has the option of opening them as 48000Hz but I'm not sure if that's right. Where is the option of saving it as 48000Hz AC3?

tebasuna51
25th February 2005, 04:56
@Sakuya
Sorry for my bad english. I hope you understand me.

About Faad:
- This program can make a wav file greater than 4 GB if the aac input is greater than 135 m. (44 Kh) or 124 m. (48 Kh). Now there are an overflow in two header's fields (4 bytes).

- Make a header WAVE_FORMAT_EXTENSIBLE with AudioFormat 0xFFFE ?, this must be changed to AudioFormat PCM 0x0001

- For this many soft (BeSweet, Soft Encode, Goldwave, ...) can't read the wav. Only BeSplit can demux this wav in 6 wav mono almost correct.

- It pops up in a note: the channel order is C,L,R,SL,SR,LFE (like aacenc/aacenc32). In reality, the order is (like faac default) : FL,FR,C,LFE,SL,SR. Soft Encode and ac3enc need: FL,C,FR,SL,SR,LFE, so you must realign. (OK Paulcat)

You can modify the Audioformat with Winhex by hand or with a script like this:

winhex AudioFor.whs

Where AudioFor.whs is:

Open "G:\FaadWav6.wav" in-place (your path and name)
Goto 0x14 (Offset of Audiformat)
Write 0x0100 (PCM, lower byte first)
Save
Exit

If your wav is < 4 GB you can now open this wav with Softencode and realign the channels or you can demux to 6 mono wav with:
BeSweet -core( -input g:\6faad_PCM.wav -output g:\ -6ch )
This make corrects g:\FL.wav, FR.wav, ...

But if your wav is > 4 GB you must use BeSplit
BeSplit -core( -input g:\6faad_PCM.wav -prefix g:\c -type wav -demux )

Now there are another problem. BeSplit has a bug (reported for me to DSPguru) in the header of the mono wavs, the field BlockAlign is fixed to 6 but it must be 2 (mono 16 bits)
You can modify the BlockAlign with Winhex by hand or with a script like this:

winhex BlockAli.whs

Where BlockAli.whs is:

Open "G:\c01.wav" in-place (your path and name)
Goto 0x20 (Offset of BlockAlign)
Write 0x0200 (lower byte first)
Save
Close
Open "G:\c02.wav" in-place (repeat for the 6 channels)
...
Save
Exit

Now, only for clarity, rename g:\c01.wav FL.wav, etc (FR,C,LFE,SL,SR) and open with Soft Encode without RAW mode and without inicial click (the bad header).

Sakuya
25th February 2005, 05:12
I got WinHex (trial) and I created a script exactly like this:

Open "D:\file.wav" in-place (your path and name)
Goto 0x14 (Offset of Audiformat)
Write 0x0100 (PCM, lower byte first)
Save
Exit
Do I need to change anything? Do I need to remove all the text in ()? Also, when I tried to execute it, it said the trial version can only execute the sample scripts. Only the professional version can execute your own scripts. What should I do now?

As for using BeSplit to separate the 6ch WAV, can I use this:


besplit -core( -input multichannel.wav -prefix mono -demux -type wav )

I used that before and it works fine. How come your code is different?
And, when and how do I change the sampling rate to 48000Hz? I used Soft Encode but it doesn't change the rate. I've checked the AC3, it is still 44100. :(

Paulcat
25th February 2005, 13:50
Sakuya:

Your method works fine. You can ignore the channel order that pops up in faad2 if you are using besplit after: the actual channel order after making your six mono wav files is L (Wav1),R (Wav2),C (Wav3),LFE (Wav4),SL (Wav5),SR (Wav6).

When you open wavs one at a time in soft encode, it will place them in the order L,C,R,SL,SR,LFE, SO TO MAKE THINGS EASIER load them in the order Wav1, Wav3, Wav2, Wav5, Wav6, Wav4 and then soft encode will have received them in the order it was expecting.

Also, if the original wav was 44100Hz, when importing the wavs into soft encode, select 44100Hz in the option box. Under ENCODE OPTIONS in the menu, you can change this to 48000Hz for AC3 creation.

If you import the wavs in a DIFFERENT order, you can re-order them by clicking on the little square that represents the channel to the left of the wav. REMEMBER to check the (right arrow) option for each wav (a drop down box will show channel 0, channel 1 with tick marks beside each) and make sure both left channels have a tick beside channel 0 only, both right channels have a tick beside channel 1 only, and the centre and lfe channels have both ticks. This is important!

Paul

I also noticed that playing the mono wav files individually in media player classic causes them to play really fast (like Alvin the chipmunk) and a partial ac3 that I made did the same. Is this normal? They play correctly when played in soft encode. Help!

Sakuya, the "-demux" option from besplit should be before the "-type" option I think...

Paulcat
25th February 2005, 14:01
Originally posted by tebasuna51
Now there are another problem. BeSplit has a bug (reported for me to DSPguru) in the header of the mono wavs, the field BlockAlign is fixed to 6 but it must be 2 (mono 16 bits)

You can modify the BlockAlign with Winhex by hand
How do you do it by hand? And if you modify 0x20 is that the 20th byte or 32nd byte ($20 HEX)? And all this will do is eliminate the chirp at the start of playback?

tebasuna51
25th February 2005, 18:09
@Sakuya
Sorry, of course without the comments in (). With the Trial version of WinHex you can make the changes by hand:

Go to Options -> Edit Mode -> In-place Mode (In the default mode it make a long backup of the file)
Open the wav6. Go to offset 0x14 (0x = hexadecimal). If there are 01 the file is ok, but if there are FE you must change to 01.
In offset 0x15 the value FF must be corrected to 00. Then save the file. Now Soft Encode open the wav like PCM, not RAW.

For the field BlockAlign in the 6 mono wav you must open the 6 mono01.wav ... mono06.wav, and go to offset 0x20 (0x = hexadecimal) and change the value 06 to 02.
I tried BeSplit v0.82 (last oficial version), v0.9b6 and v0.9b7 (last betas I know) and always with the same result.
When I open a mono wav_PCM with BlockAlign 6 in Soft Encode the sound is distorted and 3 times short (6/2).

At last, I change the sampling rate to 48000 Hz with Goldwave (Cool Edit, ...) but is shareware. I read about a free program R8Brain 1.6 (http://www.voxengo.com/downloads/#r8brain) but I don't tested yet.

@Paulcat
I tried with Soft Encode open 44100 Hz wav, and set in Encode Options 48000 Hz and the result is more acute than the original.

0x20 is hexadecimal = 32 decimal

When AudioFormat is set to PCM (0x0001) and BlockAlign is set to 02 (mono 16 bits) Soft Encode read correctly the wav header and is not necessary to open in RAW mode. Opened in RAW mode the bytes of the header is treated as music data and sound like a chirp at the start.

Sakuya
26th February 2005, 03:10
@Paulcat:
In Soft Encode, Encode Options, Audio Service Configuration, it is already set at 48000Hz with the Auto option checked. But it still outputs to 44100Hz. :( I know that it is still 44100Hz because it wouldn't let me input the AC3 in TMPGEnc DVD Author and when I added it to a video stream in Vdub, it says the stream is 44100Hz. If I convert the AC3 to 48000Hz via BeSweet (checking Create 5.1 AC3), would that mess up any AC3 sound quality? Anyway, I just did that and it seems that the AC3 lowers in volume, at least on the computer.

@tebasuna51:
What is offset 0x14 and 0x20? Where can I find that? Also, when I selected in-place mode, it warned me that the trial version can only open files below 200KB in in-place mode. My 6ch WAV is much over 200KB and therefore can only be opened as read-only. :(

tebasuna51
26th February 2005, 13:00
@Sakuya
There are many hexadecimal editors for free, but I don't know other than Winhex (prof) capable to open huge files ( > 2 GB ) like a wav6 from a movie.

Try to use, instead faad, foobar2000 (free, www.foobar2000.org) to convert the aac in a wav6_PCM and after demux in 6 mono wav with Besweet. All of this wav (if < 4 GB) have correct header.

Paulcat
26th February 2005, 17:32
TEBASUNA51:

I tried something yesterday, I opened my 6CHANNEL.WAV with WinHex, changed the 'FE FF' to '01 00', re-saved the file, and opened it with SoftEncode.

SoftEncode read all the channels fine (though I had to re-order them as SE read them in it's EXPECTED order, not the order they were in inside the WAV file). I then ran the encode part of soft encode (which took 30 minutes). I tried to play the resulting ac3 file after in media player classic and I got an error (unable to render the file) and it wouldn't play (using either MPC's built in ac3 decoder or ac3filter ).

I also tried the six mono wav option, using WinHex again to change the 06 byte to 02, and soft encode refused to open half of the six waves, telling me that "the file may be compressed data"

Can besweet open the six wav files and give me a proper ac3 file to work with?

Granted I already made a dvd from the material I have in two-channel audio, and none of this is actually NECESSARY, but dammit, there has to be a way to do this!

Sakuya
26th February 2005, 22:47
Where in foobar2000 can I select the output to be a 6ch PCM WAV? I think I just converted it to 2ch WAV by right-clicking on the AAC file and then "Convert". :(

And can anybody tell me an easier way to convert to 48000Hz before making 6 mono WAVs or the AC3? Currently, here are my steps:

1. AAC > 6ch WAV using FAAD2
2. 6ch WAV > 6 mono WAVs using BeSplit
3. 6 mono WAVs > AC3 using Soft Encode
4. 44100 Hz AC3 > 48000Hz AC3 using BeSweet

BeSweet's AC3 sounds much softer (on the computer) than Soft Encode's AC3 so I'm wondering if there's any other way to do this to decrease the steps and make it easier for myself?

Can anyone tell me if decoding AAC to 6ch WAV and then to 6 mono WAVs and then to AC3 5.1 messes up any sound quality or messes up the sound directionality? The gunfire sounds all seems to come from the center speaker and there is no LFE for it. I'm not sure if it's supposed to be like that since I don't have the source and I don't have a computer 5.1 setup. :( Plus, I don't know how AAC degrades quality when transcoded from AC3 5.1. Can anyone give me more info on this? I already read the AAC FAQ but it doesn't provide this info.

tebasuna51
28th February 2005, 02:22
@Paulcat
IF your 6 mono wav have exactly the same size in bytes and the same header (in Winhex, all the bytes until "data" and the next four) THEN
is a problem in SoftEncode
ELSE
I need more data to help you: exactly size and header of your 6 mono wav and your wav6, logs of your process faad, BeSplit or BeSweet, ...
ENDIF

OR try with Foobar2000 like I say to Sakuya

@Sakuya
If foobar convert the aac (6 channel) to a 2 channel wav maybe you have activate any DSP function like "Convert 5.1 to stereo" or "Simple surround"
Then, before "Convert->Run conversion", you must "Convert->Settings...->Processing->Unmark "Use DSP""

Another program to change 44100 Hz to 48000 Hz is ssrc-1.29 (free, http://shibatch.sourceforge.net/) directly in the 6ch WAV PCM with:
ssrc --rate 48000 wav6_PCM_44.wav wav6_PCM_48.wav

Now your steps:
1. AAC > 6ch WAV using FAAD2 (and Audioformat to PCM) or use Foobar2000
2. 6ch WAV 44100 Hz > 6ch WAV 48000 Hz using ssrc (need Audioformat PCM)
3. 6ch WAV 48000 Hz > AC3 using Soft Encode (realign the channels like say Paulcat)

All re-encode messes up any sound quality, the sound directionality is in your hands.

Sakuya
28th February 2005, 03:38
Sorry, I got mixed up! Foobar2000 did fine in creating the WAV (whether or not it is 6ch I don't know since there is no way to check). What is Audioformat to PCM? How do I do that with Foobar or FAAD2? Does it mess up the 6ch sound?

SSRC is pretty slow. It gives me some notes on what it's doing and I noticed this peculiar line:

nchannels: 8

Since when did I have 8 channels? :eek: Okay, it finished and after 100%, it gives me this error:

ssrc --
unrecognized option : --
st48000

The WAV works though. When I tried to open it in Soft Encode, it said it has more than 6 channels and cannot open it. Is this the reason why I've lost the gunfire sounds from before? :confused: Because there are actually 8 channels? AAC sucks. :(

I did a search and it seems that foobar decodes AAC 6ch to 8ch WAV. Read the comments here:
http://www.hydrogenaudio.org/forums/lofiversion/index.php/t30602.html

So should I stick with FAAD2?

Paulcat
28th February 2005, 14:16
(1) I used mkvextract to extract to an 6channel.aac file
(2) I used FAAD2 to convert to aac file to 6channel.wav
(3) I used besplit to get 6 mono wav files
(4) Used WinHex to alter the $20 byte from 06 to 02.
(5) Loaded the 6 files in the order of 1,3,2,5,6,4 into softencode and produced an ac3 file that plays fine.

My mistake was in WinHex, I changed the 06 to 01 last time instead of 02, Doh!

SAKUYA, when you select 48000 in the encode option of softencode, DO NOT check the AUTO option. Auto will read the value from the first wav file and reset itself (likely 44100).

I was having an issue with the aac file...inside the MKV, it played fine, but when I tried to play just the aac audio after extraction, it wouldn't play, although the 6channel wav file did! Odd...

Sakuya
1st March 2005, 03:55
Thanks for telling me that. Paulcat, were you successful in removing that click? How did you get Winhex to work since I'm sure your AAC file was above 200KB? Or did you buy the program already? :( Are there any other ways for me to remove the click? I tried foobar but as I said, it makes an 8ch WAV.

Paulcat
1st March 2005, 14:22
Yes the clicking sound disappeared. I didn't use the scripts in WinHex, I just opened the file, changed the byte, and re-saved it. The individual wav files were just under 200K, why? Is there a limit in filesize with the trial version?

Sakuya
1st March 2005, 20:30
In WinHex, where do I find the $20 byte? Is that the same as Offset 00000020?

Sakuya
6th March 2005, 22:31
Can anybody help me with this? Just one more little step...:(

Paulcat
7th March 2005, 14:07
The offset and the $20 byte is the same, when I open a file it's the first byte in the third row. Or, since $20 HEX is the same as 32 in decimal, it's the 32nd byte...

Sakuya
7th March 2005, 20:57
Thanks. I used Hexedit because WinHex trial wouldn't let me save. In Offset 00000020, I changed the first number in that row from 06 to 02. Then I saved it as a new WAV. But when I tried to open it in Soft Encode as a PCM WAV, it told me it cannot because it is compressed data. :(

When I loaded all of them into Soft Encode as raw data and then played all the channels at the same time, there is still a "click" in the beginning. :(

I'm guessing I didn't do this part mentioned by tebasuna. How do I do this?

Make a header WAVE_FORMAT_EXTENSIBLE with AudioFormat 0xFFFE ?, this must be changed to AudioFormat PCM 0x0001

Paulcat
7th March 2005, 21:11
Did you change the $20 byte on all six mono wav files? (not the multichannel wav)

Sakuya
7th March 2005, 22:02
Yes I did. In Hexedit, when I tried to highlight the 6 in 06, it only let me highlight the 0 before the 6. So I had to type in "02". Is that okay?

I still think it's the overflow thing with the header that tebasuna mentioned because I didn't do that part. :(

tebasuna51
8th March 2005, 03:31
I hope this info help you to verify yours wav.
This is the correct canonic header of a mono wav 16 bits 48 KHz

Offset
_____
De He Value
__ __ _____
00 00 RIFF (fix literal, 4 bytes) Chunk "RIFF"
04 04 xx xx xx xx (integer, 4 bytes, max. 4 GB) Length of file - 8
08 08 WAVE (fix literal, 4 bytes)
12 0C fmt (fix literal, 4 bytes) Subchunk "fmt "
16 10 10 00 00 00 (integer, 4 bytes) Length of Subchunk fmt - 8 (16)
20 14 01 00 (integer, 2 bytes) AudioFormat (1 = PCM)
22 16 01 00 (integer, 2 bytes) NumChannels (mono)
24 18 80 BB 00 00 (integer, 4 bytes) SampleRate (48000)
28 1C 00 77 01 00 (integer, 4 bytes) ByteRate (96000)
32 20 02 00 (integer, 2 bytes) BlockAlign (2)
34 22 10 00 (integer, 2 bytes) BitsPerSample (16)
36 24 data (fix literal, 4 bytes) Subchunk "data"
40 28 Length of Subchunk data - 8 (integer, 4 bytes)
44 2C sound data ...

Always:
BlockAlign = NumChannels x BitsPerSample / 8
ByteRate = SampleRate x BlockAlign

Integer values with the lower byte first, then:
44 AC 00 00 = 44100 dec = 0000AC44 hex

There are another format well recognized, the float 32 bits with:
AudioFormat = 3 and BitsPerSample = 32 (float)

In the header WAVE_FORMAT_EXTENSIBLE there are more fields (than canonic) in the Subchunk fmt just before the Subchunk data, then:
Length of Subchunk fmt > 24
Offset of Subchunk data = 12 + Length of Subchunk fmt

Soft Encode can read canonic or WAVE_FORMAT_EXTENSIBLE headers if the AudioFormat is 1 or 3, and if all the values are correct (BlokAlign = 2 in a mono 16 bits, file < 4 GB, etc.)
With others values of Audioformat or any field error it read in RAW mode and convert the incorrect header in sound (click).

Sakuya
8th March 2005, 03:57
I am terribly confused. :eek: I cannot discern which part of the codes in my mono WAV file is part of the header and which parts I need to edit. The layout in Hexedit or WinHex does not resemble what you've put down. :( Can you please put it in simpler terms, step-by-step for Hexedit? Sorry for being such a bother! :(

])r. Mario
8th March 2005, 20:48
hello
im also trying to go form aac 5.1 to ac3 5.1
ive used nero to go from aac to a 6 channel wav, then besplit to make 6 mono files. i have soft encode but it doesnt seem to work.
when i encode it it only does the first 7 minutes
are there other progs out there that can take 6 wavs and make an ac3 file? or is there something im doing wrong in soft encode?
any help would be greatly appreciated.


p.s. i thought something might be wrong with my wav files, so i looked into your method of makeing the 6 hannel wav. how do u do that using faad2? i think i downloaded it, but there isnt an .exe anywhere, i cant seem to find anything online either on how to use it

tebasuna51
8th March 2005, 21:09
First I want to explain the wav header with the Winhex tools.
Winhex layout of a 48 KHz mono PCM canonical wav:

Of|_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F| Literal
___________________________________________________________________
00|52 49 46 46 Xx xx xx xx 57 41 56 45 66 6D 74 20|RIFF....WAVEfmt
10|10 00 00 00 01 00 01 00 80 BB 00 00 00 77 01 00|................
20|02 00 10 00 64 61 74 61 Yy yy yy yy Ss ss Ss ss|....data........

The bytes must be grouped in fields in order to understand the meaning. Here I identify the fields by order and by name. Example: [10] BlockAlign. Disregard the "_", is only for align.

First line:
[01] First 4 bytes: ChunkID______ (literal, 4 bytes) Chunk "RIFF"
[02] Next_ 4 bytes: ChunkSize____ (integer, 4 bytes)
[03] Next_ 4 bytes: Format_______ (literal, 4 bytes) Format "WAVE"
[04] Next_ 4 bytes: Subchunk1ID__ (literal, 4 bytes) Subchunk "fmt "
Second line:
[05] First 4 bytes: Subchunk1Size (integer, 4 bytes)
[06] Next_ 2 bytes: AudioFormat__ (integer, 2 bytes)
[07] Next_ 2 bytes: NumChannels__ (integer, 2 bytes)
[08] Next_ 4 bytes: SampleRate___ (integer, 4 bytes)
[09] Next_ 4 bytes: ByteRate_____ (integer, 4 bytes)
Third line:
[10] First 2 bytes: BlockAlign___ (integer, 2 bytes)
[11] Next_ 2 bytes: BitsPerSample (integer, 2 bytes)
[12] Next_ 4 bytes: Subchunk2ID__ (literal, 4 bytes) Subchunk "data"
[13] Next_ 4 bytes: Subchunk2Size (integer, 4 bytes)
[14] Next_ 2 bytes: First_ sound sample (signed integer, 2 bytes)
[15] Next_ 2 bytes: Second sound sample ...

When I say "literal" you can see the value in column literal.
When I say "integer, 4 bytes" you can see the decimal value in the small window Data Interpreter in the line 32 Bit (+)
When I say "integer, 2 bytes" you can see the decimal value in the small window Data Interpreter in the line 16 Bit (+)
When I say "signed integer, 2 bytes" you can see the decimal value in the small window Data Interpreter in the line 16 Bit (ñ)
When I say "Offset" (position of the actual byte in the file, beginning by 0, in hexadecimal) you can see the value in the Status line.

Now the explanation of all fields (group of bytes):
(You can see also http://ccrma.stanford.edu/courses/422/projects/WaveFormat/)

[01] ChunkID = "RIFF"
Identify the file like Resource Interchange File Format

[02] ChunkSize = File length - 8 (Xx xx xx xx in the example)
All size fields contains the value of the REST of data. At this moment we are read 8 bytes (ChunkID + ChunkSize) in the file.
This field have 4 bytes, then the max value is FFFFFFFF hex = 4294967295 dec = 4 GB
Check this value (cursor in Offset 04, value in Data Interpreter) with the value in Menu File->Properties->Size in bytes (-8)
If this values don't match, you have a corrupt wav. And the 6 mono wav must have the same File length

[03] Format = "WAVE"
Identify the file like Waveform data (.WAV). The "WAVE" format consists of two subchunks: "fmt " and "data".
The "RIFF" chunk can have other formats more complex, like "AVI " Audio/visual interleaved data (.AVI).

[04] Subchunk1ID = "fmt "
The "fmt " subchunk describes the sound data's format.

[05] Subchunk1Size = 16
If this value is greater than 16, we have a header WAVE_FORMAT_EXTENSIBLE (not canonical) with more fields in the "fmt " subchunk.
Not problem if Offset of Subchunk data = 20 (dec, 14 hex) + Subchunk1Size

[06] AudioFormat = 1
This is the normal PCM format with BitsPerSample = 16 (signed integer, 2 bytes) for channel.
There are another format well recognized, the float 32 bits with AudioFormat = 3 and BitsPerSample = 32 (float, 4 bytes). It is more accurate but with twice file size.
If the Audioformat is 65534 dec = FFFE hex, like output of faad, you have a problem. You must change to 1, like the example.

[07] NumChannels = 1
Self-explanatory 1 for mono, 2 for stereo, 6 for surround 5.1.

[08] SampleRate = 48000
If you have 44100 and need one ac3 for DVD you must resample the wav to 48000.

[09] ByteRate = 96000
Always must be: ByteRate = SampleRate x NumChannels x BitsPerSample / 8

[10] BlockAlign = 2
Always must be: BlockAlign = NumChannels x BitsPerSample / 8
A bug in BeSplit fix this value to 6. You must change this value to 2 (like example).

[11] BitsPerSample = 16
If Audioformat = 1 this value must be always 16.

[12] Subchunk2ID = "data"
The "data" subchunk contains the size of the data and the actual sound

[13] Subchunk2Size = (Yy yy yy yy in the example)
The size of the data sound.
In this case must be = File length - Subchunk1Size - 28

[14] First sound sample = (Ss ss in the example)
In format signed integer, 2 bytes
In a stereo waw, the first sound sample of the Left channel

[15] Second sound sample ...
In a stereo waw, the first sound sample of the Right channel, ...

-----------------------------------------------
Now in simpler terms, step-by-step for Hexedit.
1) Open a 6 channel wav 48 KHz generated by faad. Look like this:

00|52 49 46 46 Xx xx xx xx 57 41 56 45 66 6d 74 20|RIFF....WAVEfmt
10|28 00 00 00 fe ff 06 00 80 bb 00 00 00 ca 08 00|................
20|0c 00 10 00 ... |....

First and third lines Ok. Modify at 14 and 15 (hex) like this

10|28 00 00 00 01 00 06 00 80 bb 00 00 00 ca 08 00|................

Save the file

If the wav is 44.1 KHs offsets 18 to 1F are different but not problem.

2) Use BeSplit to generate the 6 mono wav and open each of them in Hexedit:

00|52 49 46 46 Xx xx xx xx 57 41 56 45 66 6d 74 20|RIFF....WAVEfmt
10|28 00 00 00 01 00 01 00 80 bb 00 00 00 77 01 00|................
20|06 00 10 00 ... |....

Modify the third line like this

20|02 00 10 00 ... |....

Save the files

3) If you need to convert 44.1 to 48 KHz run ssrc for each wav.

4) Open the files, in correct order, in Soft Encode.

tebasuna51
8th March 2005, 21:17
@])r. Mario

For any question over aac 5.1 to ac3 5.1 put Samplerate and minutes of the aac, and filesize of the 6 channel wav.

Sakuya
9th March 2005, 05:24
@Tebasuna:

Thanks for writing all that for me, it was very helpful! I followed your Hexedit guide using a 44100Hz 6-channel WAV file. I made the changes but the 6-channel WAV after that was sped up. The original length was 25 minutes and 1 second. After processing in Hexedit, it became 22 minutes and 59 seconds. :( I'm thinking of converting to 48000Hz using Soft Encode when I'm making my AC3. So what do I change for a 44100Hz 6-channel WAV?

tebasuna51
9th March 2005, 13:57
@Sakuya

I don't understand this change in lenght.
What program say you this lengths of wav6?
Can you send me the wav6 header?
(In Hexedit mark from first byte to the four next to "data", then Copy (Ctrl+C) and Paste (Ctrl+V) in the post reply)

This is a wav 6 channels 44.1 KHz faad generated

00|52 49 46 46 3c a0 a1 00 57 41 56 45 66 6d 74 20|RIFF....WAVEfmt
10|28 00 00 00 fe ff 06 00 44 ac 00 00 30 13 08 00|................
20|0c 00 10 00 16 00 10 00 3f 00 00 00 01 00 00 00|................
30|00 00 10 00 80 00 00 aa 00 38 9b 71 64 61 74 61|............data
40|00 a0 a1 00 ... |....

Duration in seconds = Subchunk2Size / ByteRate
Where:
Subchunk2Size (offset 40 hex, 4 inverse order bytes) = 00a1a000 = 10592256
ByteRate (offset 1C hex, 4 inverse order bytes) = 00081330 = 529200
Duration in seconds = 10592256 / 529200 = 20.0156

])r. Mario
9th March 2005, 21:49
wow thx for fast response :)

ok the .aac file is 22:50 long
sample rate is 44100 Hz
after conversion 6 channel wave comes out as ~708 MB
split the 6 mono files are about 118 MB

Sakuya
10th March 2005, 03:33
My 6ch 44100Hz WAV header in Hexedit is a bit different from the one that you put in your post above:

00|52 49 46 46 3c 00 5b 2f 57 41 56 45 66 6d 74 20|RIFF<.[/WAVEfmt
10|28 00 00 00 fe ff 06 00 44 ac 00 00 30 13 08 00|(.......D...0...
20|0c 00 10 00 16 00 10 00 3f 00 00 00 01 00 00 00|........?.......
30|00 00 10 00 80 00 00 aa 00 38 9b 71 64 61 74 61|.........8.qdata

The dots to the very right are copied exactly as it is seen in Hexedit. I used FAAD2 to convert my 6ch HE-AAC to 6ch WAV. This is the code I used in FAAD2:

faad.exe -o output.wav input.aac

tebasuna51
10th March 2005, 03:38
@])r. Mario

Are you read this post completely?. The answer is there.
When you open this wavs in Soft Encode see the Time Line. Only 7:36, then Soft Encode finish Ok.
The problem is the bug in BeSplit with the field BlockAlign. Soft Encode see a 6 (must be 2) and read the wav three times short (20:50 / 3 = 7:36) and distorted.

With not huge wav6 files generated by Nero (o Foobar) is better split the file with Besweet:
BeSweet -core( -input g:\wav_6.wav -output g:\ -6CH )

Then you have: g:\FL.wav, C, FR, SL, SR, LFE
My Nero aac plugin put the channel order in the wav6: C, FL, FR, SL, SR, LFE
Then I must change FL.wav <-> C.wav
Foobar put the channel order in the wav6: FL, FR, C, LFE, SL, SR
The I must use the parameter for Besweet: -6ch (lowercase) and the names for the mono wav are ok.

tebasuna51
10th March 2005, 04:50
@Sakuya

1) Open output.wav in Hexedit and modify the Audioformat (second line, bytes 5 and 6) like this:

00|52 49 46 46 3c 00 5b 2f 57 41 56 45 66 6d 74 20|RIFF<.[/WAVEfmt
10|28 00 00 00 01 00 06 00 44 ac 00 00 30 13 08 00|(.......D...0...
20|0c 00 10 00 16 00 10 00 3f 00 00 00 01 00 00 00|........?.......
30|00 00 10 00 80 00 00 aa 00 38 9b 71 64 61 74 61|.........8.qdata
40|00 00 5b 2f

Save as output1.wav

2) Split the wav with Besweet (canonical header, no error in BLockAlign):
BeSweet -core( -input output1.wav -6ch )
Then you have: FL.wav, C, FR, SL, SR, LFE

3) Each mono wav must have 132415532 bytes and the header:

00|52 49 46 46 24 00 48 7e 57 41 56 45 66 6d 74 20|RIFF....WAVEfmt
10|10 00 00 00 01 00 01 00 44 ac 00 00 88 58 01 00|
20|02 00 10 00 64 61 74 61 00 00 48 7e

])r. Mario
10th March 2005, 07:05
@tebasuna51
i read the thread from the beggining, but must have not understood something, sorry :(

so are u saying that i should use besweet to make the 6 channel wave? or to split it?
if the bug is in besplit wont it still affect the wav?
yeah, i noticed right off that nreo wasnt assigning the channels correctly, i had to switch the FL with the C channel.
from what i understand your saying i should make the 6 channle wav from the aac file using besweet. ill try that
thx a lot for the help :)

])r. Mario
10th March 2005, 07:10
oops, just reread the post
u want me to split the 6 chan wav with besweet right?
sorry for the confusion, well, my confusion anyway:)

Sakuya
10th March 2005, 07:52
In BeSweet command line, I entered this but it won't work:

BeSweet -core( -D:\input.wav D:\output1.wav -6ch )

It only shows me definitions of each switch in BeSweet. :( I have a feeling I typed it wrong for the input and output.

tebasuna51
10th March 2005, 18:14
I know, my english is very bad and can't explain you correctly.

@])r. Mario
Three choices:

1) You can open directly the wav6 in Soft Encode. Then in the square icon at the left of the first track, click in the Center Channel. The second track is automatically set to Front Left channel. All is Ok. Encode.
(See PaulCat's comments in this post)

2) If you want to split the wav6 in 6 wav mono use BeSweet

3) If you want to split the wav6 in 6 wav mono with BeSplit, after you must correct the wav header field BlockAlign, like I say to Sakuya, in the six mono wav's.

@Sakuya

BeSweet -core( -D:\input.wav D:\output1.wav -6ch ) ???

If your modified wav, by Hexedit, is D:\output1.wav, use:

BeSweet -core( -input D:\output1.wav -output D:\ -6ch )

BeSweet puts automatically the file names to: D:\FL.wav, C, FR, SL, SR, LFE

Sakuya
12th March 2005, 03:42
Thanks Tebasuna, it worked! But however, my AC3 turned out to be shortened to 22 minutes and 59 seconds by Soft Encode. Why does it do that? :( Like Paulcat said, I set Soft Encode's Encode Settings to 48000Hz and UNCHECKED "Auto". Right now, here are the steps to get everything in perfect condition, including the sample rate:

1. AAC to 6ch WAV using FAAD2
2. Hexedit
3. 44100 to 48000 using SSRC
4. 6 mono WAV using BeSweet
5. AC3 using Soft Encode

Is there a way to compact my steps? For example, do the sample rate change in BeSweet instead of SSRC? That would make it much easier by using just one code in BeSweet to change the sample rate and splitting the 6ch WAV into 6 mono streams.

tebasuna51
13th March 2005, 12:58
I try with:

BeSweet v1.5b29 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).

Logging start : 03/13/05 , 12:40:47.

BeSweet -core( -input g:\wav6_44.wav -6ch ) -shibatch( --rate 48000 )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : g:\wav6_44.wav
[00:00:00:000] | Output: FL, FR, SL, SR, C, LFE
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 44.1KHz
[00:00:00:000] | Dest. Sample-Rate: 48.0KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +---------------------
[00:00:20:000] Conversion Completed !
[00:00:05:000] <-- Transcoding Duration

Logging ends : 03/13/05 , 12:40:52.

But don't work, erroneous mono wav. Sorry.

Sakuya
13th March 2005, 22:13
Ok then, thanks for the help! I'll use the steps I have above then. :D

Sakuya
8th June 2005, 02:25
Okay, I gave up on the project that needed this sort of conversion several months ago. But now, I need it again. But just in time, Hexedit is not working on me!

I have a split MKV with AAC 5.1 sound. But I don't know if it is LC or HE. I used mkvtoolnix to merge them together and then used mkvextractGUI to get the AAC file. Then I used mp_rel to get the timecodes and the AVI. Fast forward to the 6ch WAV and I have to edit the header. Hexedit loads it and when the window comes up, it crashes. It's happened for the fourth time in a row. Is the WAV too big? It's 2.94GB. Is there another way? What determines that I need to change the header? Can I just skip the header part and proceed to changing the sampling rate to 48000 in SSRC?

johnman
8th June 2005, 15:03
I havent read the whole thread but i did see some problem with upsampling and the number of channels. If you got a VALLID wav, wavewizard can do upsampling and splitting streams to mono wav's in a single run. BTW wavewizard shows the number of channels in the wav if you wonder about this. Wavewizard can be found on http://forum.doom9.org/showthread.php?t=95265.

(im not trying to spam my program, but in this case i think it might help).

Paulcat
8th June 2005, 20:51
Okay, I gave up on the project that needed this sort of conversion several months ago. But now, I need it again. But just in time, Hexedit is not working on me!

I have a split MKV with AAC 5.1 sound. But I don't know if it is LC or HE. I used mkvtoolnix to merge them together and then used mkvextractGUI to get the AAC file. Then I used mp_rel to get the timecodes and the AVI. Fast forward to the 6ch WAV and I have to edit the header. Hexedit loads it and when the window comes up, it crashes. It's happened for the fourth time in a row. Is the WAV too big? It's 2.94GB. Is there another way? What determines that I need to change the header? Can I just skip the header part and proceed to changing the sampling rate to 48000 in SSRC?

I have downloaded the latest STABLE versions of BeSweet and BeLight (a GUI for BeSweet), and it appears you can do a direct conversion from AAC to AC3 from there without any trouble. Have you tried this? It would be easier than making waves (heh heh).

Sakuya
8th June 2005, 21:16
I currently have BeSweet and BeSweet GUI. The GUI is v0.7b4. And last time I tried BeLight, the "Start" button keeps disappearing on me. I forgot how I got it to work again but every time I start the program, the button is at the very very very very bottom hidden by the Windows toolbar.

And are you sure the 6ch will be kept? In possibly good quality? :confused: So what must I do? I'm a bit hesitant on my BeSweet v1.4. What versions did you use? The latest stable BeLight is v0.21.

johnman
8th June 2005, 22:19
I would not use besweet ac3 encoding because it will heavily reduce the quality of the audio. But you can always try ofcourse.

Sakuya
9th June 2005, 07:34
Okay, I tried it out and it crashes every single time. :( Hexedit crashes too. Winhex won't let me save. Soft Encode won't let me open. This is the worst. Nothing works for me. :angry:

johnman
9th June 2005, 10:14
Okay, I tried it out and it crashes every single time.
What crashes?


Winhex won't let me save.

If a program has freezed an got a lock on the file you cant save or edit it. Sometimes you cant even open it. If you dont know how to shutdown processes you need to restart the computer. Doesnt winhex tell why you cant save?

magicclue
9th June 2005, 12:19
:stupid: :p Hi there!

Sorry but this thread is way too long. So I will just try to tell two ways to transcode in an easy way with all channels in right order.

FAQ: Foobar2000 / Nero cannot transcode aac 5.1->wav correctly (hydrogenaudio). You'll end up with 8 multichannel wav.
Instead use aacDecDrop (http://www.rarewares.org/aac.html)

Easy but long way without GraphEdit:

With aacDecDrop (http://www.rarewares.org/aac.html) (drag and drop AAC/MP4 on it) to decode to a 6 multichannel wav.

Use BeSweet to separate into 6 mono Waves.
Attention: The naming of the files is wrong. You've to rename them to get correct channel mapping.

The channel mapping is as follows:

filename = channel name
FL.wav = Center
C.wav = Front Right
FR.wav = Front Left
SL.wav = Surround Right
SR.wav = LFE
LFE.wav = Surround Left


So the file C.wav is the Front Right channel!
e.g. rename c.wav to fr.wav

magicclue
9th June 2005, 12:28
Fast method with ffdshow:

get GraphEdit from: http://www.3ivx.com/download/windows.html look for the link to GraphEdit in the upper right corner.

get new FFDSHOW from: http://www.aziendeassociate.it/cd.asp?dir=/ffdshow download newest version of ffdshow

-install ffdshow
-activate decoding for aac!
-extract graphedit in a folder
-start graphedit
-drag&drop AAC-file in GraphEdit window
-click and remove "default direct sound device"
- click Menu graph->insert new filter->DirectShowFilter->Filewriter and "insert filter", choose filename "convert.ac3"
-right click on ffdshow->properties->output->AC3 and "allow direct-to-file output" and "don't use Waveformatextensible"
-click ok

[see figure 1]

-connect ffdshow filter with the file writer "convert.ac3" filter
-click play to start conversion and wait until its finished

[see figure 2]

If your output stutters it is very likely that your sampling rate is 44KHz and not 48KHz Some soundcard don't output 44KHz over S/PDIF correctly. To solve this, activate the resampler in ffdshow and set it to "Resample if sampling rate below... 48000Hz".

johnman
9th June 2005, 12:51
:stupid:

thx :angry:

magicclue
9th June 2005, 14:20
? Hey take it easy not personally. I'm stupid :D

:thanks: for the guides.

johnman
9th June 2005, 15:00
DOH..... clicked wrong face, what i meant was

thx :p

cant see how i missed that one

Sakuya
9th June 2005, 21:23
Thanks magicclue! :goodpost: I can't wait to try that. For AACDecDrop, it gives me an error message because it cannot find the dynamic link library libmmd.dll. :eek:

And to answer johnman's question, Hexedit crashes when I try to open the 6ch WAV. Winhex won't let me save anything above 200KB because it's the trial version.

magicclue
9th June 2005, 21:48
just download the libmmd.dll from www.rarewares.org as well...
put it in the according application folder
or -> in system32

you'll need that dll for alot of programs..

Sakuya
9th June 2005, 22:07
Thanks. It's working now. Just a thought. In BeSweet, it says this:

+------- BeSweet -----
| Input : file.wav
| Output: FL, FR, SL, SR, C, LFE
| Floating-Point Process: No
| Source Sample-Rate: 22.1KHz
+---------------------

Does that have to be 48000? Do I need to convert it to be 48000?

johnman
9th June 2005, 22:28
Thanks. It's working now. Just a thought. In BeSweet, it says this:

+------- BeSweet -----
| Input : file.wav
| Output: FL, FR, SL, SR, C, LFE
| Floating-Point Process: No
| Source Sample-Rate: 22.1KHz
+---------------------

Does that have to be 48000? Do I need to convert it to be 48000?

As you have noticed im no aac guru, but 22.1khz doesnt seem good to me. 22 khz smplrate means there is no sound above +- 11khz. And if you wonder about it, upsampling doesnt help once the samplerate has been lowerd.

magicclue
9th June 2005, 23:06
T... Does that have to be 48000? Do I need to convert it to be 48000?

? I don't know what you want to do or what type of source you use?!
If your source is bad it won't help.
Just leave as it is although I cannot think of why someone would record at that frequency :eek:

The only thing I can think of to convert to 48KHz would be to use that sound for a DVD.

Sakuya
9th June 2005, 23:37
Yes, I'm making a DVD. In Soft Encode, under Encode Settings, I set it to 48KHz and the end result is very fast-paced as if it was being fast-forwarded. :eek: So now I'm setting that option to auto, which is 44.1KHz and re-encoding. :( How can I get it to be 48KHz without it being fast-paced?

johnman
10th June 2005, 00:20
If it plays to fast it could mean the samplerate is wrong. If you i.e. play a 22khz at 44kz you also hear its to fast and high.
To change this you must not resample, but edit the samplerate to the correct value. Cool edit has an option for this called "Adjust samplerate". Maybe other porgrams can do the same thing but i dont know any(maybe besweet?) . Can you give the ratio by which it has been speed up. You can calculate this by dividing the short length by the original length.

Sakuya
10th June 2005, 00:47
The original length is 1 hour, 39 minutes, 45 seconds. The AC3 is 49 minutes, 53 seconds. Cool Edit Pro cannot load AC3 files. I tried AC3Machine but the result is the same fast and high-pitched. :(

johnman
10th June 2005, 01:28
The ratio between in and output is almost exactly 2, so my gues is this is caused playing 22 @ 44 khz.

Since you are using soft encode to encode it, im asuming you've got the sound as a wav. What you need to do is to make a good wav and encode it. So the first thing you should do is check if the wav is correct so first check this. If it has the correct length and plays correct you should upsample it to 48khz. Then you can just insert in surcode and let sonic SE encode it at 48khz. Then the ac3 should come out good.

If the original wav isnt correct you should deal with that first.

Sakuya
10th June 2005, 01:31
Yes, I checked and the 6ch WAV has a length of 1 hour 39 minutes and 45 seconds (or 99 minutes and 45 seconds). :( So the problem is with Soft Encode?

johnman
10th June 2005, 01:42
Yes, I checked and the 6ch WAV has a length of 1 hour 39 minutes and 45 seconds (or 99 minutes and 45 seconds). :( So the problem is with Soft Encode?

Is the original also 48 khz? If not upsample it first and THEN insert it in sonic SE.

Sakuya
10th June 2005, 01:45
How do I check if it is? :confused: And what do I use to upsample?

Edit:
I used SSRC to try to convert the sampling rate and it says:

22050 > 48000

Which means that it is 22050KHz. Now then, what do I use to upsample?

johnman
10th June 2005, 01:51
You can use ssrc to upsample, or wavewizard if you dont like cli's.
Wavewizard also shows the original samplerate.
For wavewizard look @ http://forum.doom9.org/showthread.php?t=95265

Remember to set channelmapping off in the preferences.

EDIT
ssrc can upsample, and you should actually use ssrc_hp

i believe you should do something like ssrc_hp --rate 48000 in.wav out.wav

Sakuya
10th June 2005, 02:31
I have tried ssrc_hp but it resulted in an erroneous WAV that won't play in Media Player Classic. Not to mention the file was extended to 2 hours and 4 minutes.

I have also tried WaveWizard but the result was "damaged" as the error in Media Player Classic said. So now, I will have to wait for the pictures to show up in the other method that magicclue posted. Meanwhile, any other ideas? :confused:

Edit:
I tried the ffdshow method and still the same problem with the sampling rate! Tomorrow when I have more time, I will open the 6ch WAV with Cool Edit and convert the sampling rate (adjusting the rate won't do any good, I've tried).

johnman
10th June 2005, 10:45
If you want to test the 6 ch stream you can make monofiles from them and check these with a program like CE. This way you can see what went wrong.
Wavewizard can also make monstreams from files.


I dont know mediaplayer classic, but i wouldnt use it for testing.

(maybe im lucky, but i havent had a bad stream from wavewizard nor ssrc ever)

EDIT and another way to test the file pops into my head :). Just drop the wrong file again in wavewizard. Wavewiz is pretty strict about the format so if ww accepts it, i cant immagina what's wrong.

EDIT 2 how big is the file?

magicclue
10th June 2005, 14:03
... I set it to 48KHz and the end result is very fast-paced as if it was being fast-forwarded. :eek: So now I'm setting that option to auto, which is 44.1KHz and re-encoding. :( How can I get it to be 48KHz without it being fast-paced?

Please please I BEG YOU
:readfaq:
:search:

There are alot of guides all over the froum and on the front page.
Read some basics and you'll be able to do all what you want!

A hint: ->besweet->ssrc

did you READ my conversion guide???
Well it's all there.

tebasuna51
10th June 2005, 17:36
1) Recent alpha versions of ffdshow can transcode directly from aac to ac3 (with GraphEdit). Is the best way ... but not for me, because I have others troubles with this versions and I return to the last "official" alpha 20041012. Maybe in the future.

2) If you need edit or resample the wav (Can ffdshow do the upsampling 44.1 KHz -> 48 KHz. on-the-fly?) you must use the long method.
To decode the aac I use Foobar2000 without problems. I tried now AacDrop and run Ok for me (only the downsampling to half frecuency when the aac is low quality)

A words to explain my method in previous posts. There are two limits for the size of the wavs (with canonical header) 2 and 4 GB. In the header there are a field of four bytes to put the length of data, if the soft read this four bytes like signed integer only can manage 2 GB, read like unsigned integer can manage 4 GB.
And more..., Faad, FooBar2000 and AacDrop can write corrects wav's greater than 4 GB with only an error in the field mentioned (and in a second field for the length of file).
BeSplit is the only soft, I know, to demux in 6 mono wavs this wav6 > 4 GB and after be open in a wav editor or SoftEncode.

Is interesting to know this limits in function of the time of the aac. For an aac 48 KHz:
Time.aac Size wav6 Header SoftEncode BeSweet WaveWizard BeSplit
________ ________ _____ __________ _______ __________ ______
_62m.aac _1.99 GB_ __OK_ ____OK___ __OK___ ____OK____ __OK
_63m.aac _2.03 GB_ __OK_ ____NO___ __NO___ ____OK____ __OK
124m.aac _3.99 GB_ __OK_ ____NO___ __NO___ ____OK____ __OK
125m.aac _4.02 GB_ __NO_ ____NO___ __NO___ ____NO____ __OK

(Limits for 44.1 KHz: 67/68 m and 135/136 m.)

Only for aac > 124 m. is necessary to use BeSplit and WinHex to correct a bug in the field BlockAlign (bug reported, but I think DspGuru is out).
Of course you can split the aac in parts, reencode to ac3, and after join them.

Can WaveWizard ignore the data length field, like BeSplit, and prompt if you want to split in mono wav's using the real length of the file?. Then the problem is resolved.

johnman
10th June 2005, 19:27
This is slightly OT but may be usefull.

Can WaveWizard ignore the data length field, like BeSplit, and prompt if you want to split in mono wav's using the real length of the file?

I just added this feature. The new release wil have an option in the preferences to ignore invalid wav size . This also implies the current version cant cant do this. Its also possible to use the wavewiz format as an intermediate format. This has a 64 bit number for the filesize (filesize can be 2^64).

magicclue
10th June 2005, 20:02
1) Recent alpha versions of ffdshow can transcode directly from aac to ac3 (with GraphEdit).

yep. see my guide above.

Can ffdshow do the upsampling 44.1 KHz -> 48 KHz. on-the-fly?
yes, no problem.


BeSplit is the only soft, I know, to demux in 6 mono wavs this wav6 > 4 GB
have you tried "Transcode" to separate the 6 channel wav to mono wavs?
It's a new Soft floating in the forum. It's just some weeks old.

Link to Transcode (http://forum.doom9.org/showthread.php?p=648990#post648990)

Sakuya
10th June 2005, 20:57
I think I've found my problem. I just realized that my AAC has a length of 1:39:45 while my AVI is 1:39:52. Stupid VFR MKV. I'll have to go to the other thread about this before proceeding with this audio.

Thanks for the help! :scared:

tebasuna51
10th June 2005, 23:36
Tranzcode works!

I have a 130 m. wav6 and open in tranzcode_GUI inform:
Duration: 7456.540 sec. (124.27 min. just 4 GB)
But after 30 min. waiting I have 6 mono wav's with the exact 130 min.

I tried it last week, but in the input dialog offers DTS and DTSWAV only and I have closed the program.
It work also for PCM WAV.

Thanks.

magicclue
11th June 2005, 11:44
Tranzcode works!
...It work also for PCM WAV...

wonderful!

yep. Kurtnoise should update the input dialog.
I'll mail him.

Steffi
13th August 2005, 08:03
hi!

Tried your way to convert aac to ac3, but my filters wont connect with fddshow? Any clue, why?
thx.

Steffi
13th August 2005, 08:16
Fast method with ffdshow:

get GraphEdit from: http://www.3ivx.com/download/windows.html look for the link to GraphEdit in the upper right corner.

get new FFDSHOW from: http://www.aziendeassociate.it/cd.asp?dir=/ffdshow download newest version of ffdshow

-install ffdshow
-activate decoding for aac!
-extract graphedit in a folder
-start graphedit
-drag&drop AAC-file in GraphEdit window
-click and remove "default direct sound device"
- click Menu graph->insert new filter->DirectShowFilter->Filewriter and "insert filter", choose filename "convert.ac3"
-right click on ffdshow->properties->output->AC3 and "allow direct-to-file output" and "don't use Waveformatextensible"

[see figure 1]

-swap channels->choose according channel mapping exactly as seen in figure 2!
-click ok

[see figure 2]

-connect ffdshow filter with the file writer "convert.ac3" filter
-click play to start conversion and wait until its finished

[see figure 3]


my filters wont connect, any clue?

tebasuna51
13th August 2005, 09:12
In http://forum.doom9.org/showthread.php?t=98133&page=2 I wrote:

"@magicclue
I report two differences with your method aac -> ac3 with ffdshow:

1) In GraphEdit I can't connect directly any aac file with ffdshow audio decoder. With Connect Intelligent disabled send me a error, enabled insert a aac_parser: AAC_parser from http://www.rarewares.org/aac.html or nero_aac_parser.

2) I don't need to remap any channel. With channelmapping disabled I make a correct ac3."

For me work with: aac -> AAC_Parser -> ffdshow -> file writer
And without channelmapping.

magicclue
14th August 2005, 08:28
@tebasuna51: thanks. Guide corrected.

As for filters in GraphEdit not connecting to ffshow audio decoder: activate "allow ffdshow to connect to any filter" and "direct-file-output".
AND activate FFDSHOW as decoder for the file format you want to convert (see codec tab)!
So activate ffdhsow for aac/m4a
Else I don't know.

tebasuna51
14th August 2005, 16:07
I have:
Windows XP Pro, SP 1
GraphEdit (Build 040927) from http://www.3ivx.com/download/windows.html
ffdshow 2005-08-03 with:

Codecs -> AAC - realaac (Enabled)
Connect to: -> any filter
Allow direct-to-file output: Enabled
Don't use Waveformatextensible header when not needed: Enabled

And still need a AAC_parser.
No problem for me (works fine) but maybe the Steffi's problem.

Rockaria
14th August 2005, 16:47
I have the same configuration except the graphedit(build 041201). But the ffdshow didn't need the AAC_Parser for both AAC and MP4. AC3Filter also only needed the CoreAAC directshow filter.

AAC parser filter for DirectShow 2003-11-25
Parser for decoding unwrapped AAC streams in DirectShow compatible players (Windows Media Player, Media Player Classic, RadLight, ZoomPlayer...) - requires an AAC decoder filter (CoreAAC or 3ivX's) - by Tom Judd - v 1.1.0

Maybe the AAC formats are different? Which AAC encoder did you use? I used nero he+AAC encoder to make the the source in the foobar2k.

tebasuna51
14th August 2005, 19:52
@Rockaria
The same wav 6 channel converted with different method (and extension):

Belight_Nero_Plugin.mp4: directly to ffdshow
Faac1.24+/Foobar_faac.mp4: directly to ffdshow

Faac1.24+/Foobar_faac.aac: need AAC_Parser
WaveWizard_NeroFends_ISO_13818-7.aac: need AAC_Parser
Ahead AAC Encoder v2.9_Frontend v0.74.aac: need AAC_Parser
PsyTEL(R) MPEG-4 AAC Encoder V2.15.aac: need AAC_Parser
Track2.aac from Matrix Reloaded Trailer-HE_AAC_sub.mkv: need AAC_parser

Faac1.24+/Foobar_faac.m4a: need 3ivx D4 Media Splitter
WaveWizard_NeroFends_NO_ISO_13818-7.aac: need 3ivx D4 Media Splitter

Rockaria
16th August 2005, 08:07
9. What is the difference between *.AAC and *.MP4 and *.M4A?

AAC files usually contain AAC with ADTS headers or raw AAC data streams. Raw AAC cannot be processed without decoding some of the stream. MP4, on the other hand, is a container format of the MPEG4 standard which can contain AAC streams and many other things. The data format of the two is very different and hence you cannot rename them to one another, they must be muxed (put into the container) or demuxed. Muxing of AAC into MP4 and demuxing can be done with Ivan & Menno. M4A is normally audio in an MP4 container that has been renamed to clarify that it is audio only. Itunes, Winamp5, and Realplayer gold encode to M4A now by default. Note that M4A and MP4 files can be switched to each other by simply renaming, since they are both extensions for the same container format.

Note that the "Export ISO 13818-7 Stream" option in the Nero encoder produces *.AAC files with ADTS headers. Again this is not a raw aac stream, Ivan & Menno is required to convert to raw aac.

7. What do I need for AAC playback?

Download and install the CoreAAC DirectShow filter or the 3ivx audio decoder (bundled with 3ivx codec), both are excellent for AAC (Both LC and HE) playback in any directshow compatible media player. For the latest CoreAAC filter and winamp/foobar plugins, refer to john33's thread at HydrogenAudio.org.

Note that for MP4 streams, 3ivx or another MPEG-4 splitter is required for playback in DirectShow compatible media players. For raw AAC streams, the AACparser filter from rarewares is required. When muxing in OGM or Matroska, an appropriate splitter is needed as well. See the FAQs in the New Container Formats forum for more information.


Quoted from the Audio FAQ (http://forum.doom9.org/showthread.php?p=424070#post424070) sticky.

tebasuna51
17th August 2005, 01:28
@Rockaria
Yes. I know that.

Faac1.24+.m4a and Faac1.24+.mp4 are identical internally (and Foobar.m4a with Foobar.mp4). Then, why don't can connect, in GraphEdit, with ffdshow the .m4a like the .mp4?

The answer can't be the internal format (there are identical), I think GraphEdit works different in each system (installed DirectShow filters, ID, merit, ...), and for that my post.

Rockaria
17th August 2005, 04:33
@Rockaria
Yes. I know that.
Yeah, you seem to be knowing it already. :stupid:

Actually my posts were for anybody who has trouble in connecting the ffdshow dsfilter to an uncertain format AAC file.
And nobody knows better than oneself about the own system, now very few things to say in common....

Lothar
7th September 2005, 10:40
After using faad (else i get a 8-ch wave or a downsampled one) to convert from aac to 6ch-wave, I need to change the duration to obtain a 25-frames ac3 pal from a 23.9376-frames aac ntsc, and even after editing the header with winhex (or using wavewizard) besweet doesn't work with the 6ch-wave.

The only method that gets me to have the 6 working waves is using tranzcode to have the 6 waves (correct order, it seams).

But I can't create a mono-wave from a mono-wave using besweet....

Thanks for the help!

tebasuna51
7th September 2005, 13:22
1) You don't need chage the duration of audio, you need change the framerate of the video from 23.9376 to 25 fps preserving the duration. Virtualdub can insert a DUP frame to obtain a new 25 fps video with more frames but with the same duration:
Virtualdub -> Video -> Direct stream copy
Virtualdub -> Video -> Framerate -> Frame rate converssion -> Convert to fps: 25

2) If you use:
Virtualdub -> Video -> Framerate -> Source rate adjustment -> Change to 25 fps
Then VirtualDub don't insert DUP frames and the video play more quickly than real movie. In this case you need a more short audio. Use Audacity (any audio editor) over the 6 mono wav, or if you want use BeSweet, you can merge the 6 mono wav in 3 stereo wav with WaveWizard or with a .mux file with BeSweet

I always use the first method without change the audio.

Lothar
7th September 2005, 22:28
I used audition instead of audacity (i don't know why but with audacity i couldn't get the right duration) to adjust the speed of the mono waves, and it seems everything is fine now.

Thx for the help.

blizzard
11th September 2005, 00:51
I used the graphedit way to convert the he-aac to ac3 and it does work but there is something i don't understand.
For example, if the original audio is 160kb/s while he-aac which compression should i choose in ffdshow so that it will lose the minimum quality possible?
If i have 160kb/s at start and in ffdshow choose 160kb/s the resulting sound will be crappy...so it should need an higher number!
Is there any kind of ratio that i should be aware?
Thank you

Rockaria
11th September 2005, 01:51
If we suppose the 160kbps he-aac contains 80% of the quality, you cannot achieve even the same 80% fidelity with the lossy AC3 codec at it's full 640kbps bandwidth.
So minimizing the transcoding chain is always advised in lossy encoding.

tebasuna51
11th September 2005, 04:19
@blizzard
If you want convert to ac3 I think the aac is a multichannel 5.1. Then 160 Kbps for a 5.1 is a low quality, but if you don't want lose more quality you must be generous with the ac3 bitrate.

A parameter to be considered is the bandwidth:
A 5.1 ac3 with 224 kbps have 9.05 KHz , 256 -> 12.42, 320 -> 15.8, 384 -> 18.05, 448 -> 20.3 KHz (maximum).
By my test I think that HE-aac do the first 9 KHz like LC and the SBR section do the band 9-18KHz (with less quality).
Then, if you don't want lose nothing, you need 384 kbps (bandwith 18.05 KHz), smaller bitrate lose high frequencies.

Rockaria
11th September 2005, 09:10
The bandwidth by tebasuna51 is pricisely the cutoff frequency(tone) of the sound while mine is the bitrate per second to sample and compress the wav(pcm) signal to ac3.
The codecs tend to cut off the high frequencies(inaudible area) to achieve the pleasing sound for human with less size(bit rate), which affect the overall quality very little.
Over 17khz is almost audiophile zone : supersonic.

If you look at the ffdshow-> output, you will find the ac3 bit rate upto 640.
What I can suggest is to keep the original format from the aac :
. sample size(probably 16) : the dynamic volume range also affect the quality
. sample rate(mostly 44.1khz or 48khz) : 48khz is almost a standard to pc or external devices

Just change the bit rate between 192~640 to get the proper target quality.
You might also want to control the volume to get proper gain(volume + DRC)

What is better with the ffdshow method is you can listen what you get by attaching the default sound device before doing the main job.

blizzard
16th September 2005, 02:42
Ok guys.Thank you very much for the help!

Aragorn Skywalker
3rd July 2006, 02:28
Hi,

I'm trying to convert a 5.1 AAC into a 5.1 ac3 file for use in DVDLab. I'm having trouble following the guides. I'm new at all of this so any help would be great.

I have FFDSHOW and Graphedit installed.

When I drag and dog the AAC file into Graphedit it gives me this error:

Could not construct a graph for the file
-Have you installed all needed filters?
-Note that the 'render file' menu option cannot read *.grf files

Classfactory cannot supply requested class (return code 0x80040111)

What am I doing wrong?

Livesms
22nd December 2006, 10:14
So is there any correct way to get best results for aac->ac3 conversion

How can I get right 6 wav mono files and no to mess with channels.
I will use Sony Encode to convert 6 mono wav to AC3 5.1

Livesms
22nd December 2006, 12:11
I have 6channel wav file (from aacDECdrop)

When I try smth like this

D:\1>D:\1\BeSweet.exe -core( -input D:\1\1.wav -output D:\1\ -6ch )
BeSweet v1.4 by DSPguru.
--------------------------

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : D:\1\1.wav
[00:00:00:000] | Output: FL, FR, SL, SR, C, LFE
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +---------------------
[00:00:00:032] Conversion Completed !
[00:00:00:000] <-- Transcoding Duration


Visit DSPguru's Homepage at :
http://DSPguru.doom9.net/

And after that there is 6 files all 3116 bytes
3*116 C.wav
3116 FL.wav
3116 FR.wav
3116 LFE.wav
3116 SL.wav
3116 SR.wav

Why? Is therу any way to fix this problem and get right 6 mono wav files.

tebasuna51
22nd December 2006, 13:16
So is there any correct way to get best results for aac->ac3 conversion

How can I get right 6 wav mono files and no to mess with channels.
I will use Sony Encode to convert 6 mono wav to AC3 5.1
Then you need a decoder and split the wav6chan in mono Wav's.

Best is a forbidden word in this forum then I propose you three decoder and two split methods, there are more of course.

Decoders:
- Foobar2000 (http://www.foobar2000.org/), the output can be piped to the spliter.
- Faad2 (http://www.rarewares.org/aac.html), the output can't be piped then you need a intermediate wav6chan (can be >4GB).
- your default DirectShow aac decoder (properly configured), the output can be piped to the spliter.

To split in mono wav's:
- WaveWizard (http://www.rarewares.org/wavewiz/wavewizardv0.54b.zip), accept any kind of wav6chan (int16-24-32, float32-64, WAVE_FORMAT_EXTENSIBLE, >4GB) like input.
- Wav2mono, written for Bepipe/BeHappy but can be used also with Foobar2000 or in command line mode with support also for int16-24-32, float32-64, WAVE_FORMAT_EXTENSIBLE, >4GB.

To use wav2mono with Foobar2000 see my post (http://forum.doom9.org/showthread.php?p=901020#post901020)
The "3) convert a .dts or .ac3 to 6 mono wav" is valid for any number of channels and any format (like aac) supported by Foobar. In this post you have also a link to obtain wav2mono.

To use wav2mono with DirectShow aac decoder you need Bepipe/Behappy, AviSynth and .NET Framework v2.0 and:
bepipe --script "DirectShowSource(^yourpath\your.aac^)" | wav2mono - prefix.wav -ignorelength

To use wav2mono in command line mode:
faad -o intermediate.wav input.aac
wav2mono intermediate.wav -ignorelength

Livesms
22nd December 2006, 13:37
To use wav2mono with DirectShow aac decoder you need Bepipe/Behappy, AviSynth and .NET Framework v2.0 and:
bepipe --script "DirectShowSource(^yourpath\your.aac^)" | wav2mono - prefix.wav -ignorelength

To use wav2mono in command line mode:
faad -o intermediate.wav input.aac
wav2mono intermediate.wav -ignorelength

I used aacDECdrop.exe to convert aac track to 6ch wav track (4.34gb size)
And then
besplit -core( -input 1.wav -prefix mono -demux -type wav )

and mono01.wav - mono06.wav was prodused.

Then
Open "D:\1\mono01.wav" in-place (your path and name)
Goto 0x14 (Offset of Audiformat)
Write 0x0100 (PCM, lower byte first)
Save
Exit


But tebasuna51 tells (http://forum.doom9.org/showthread.php?p=616235#post616235) that order is FL, FR,C,LFE,SL,SR - but i my case center (with speach ) is mono01.wav and LFE (moslty silent) is mono06.wav

What shall I do
Can I assume
mono01.wav - C
mono02.wav - FL
mono03.wav - FR
mono04.wav - SL
mono05.wav - SR
mono06.wav - LFE
Is there any way to found out this?

PS: Can you give me a link to wav2mono. Cause tebasuna51 link posted here (http://forum.doom9.org/showthread.php?p=886080#post886080) is temp. down :(

tebasuna51
22nd December 2006, 13:45
I have 6channel wav file (from aacDECdrop)
aacDECdrop produce a wrong channelmapped wav (C,FL,FR,SL,SR,LFE), must be FL,FR,C,LFE,SL,SR. Also the samplerate is half than original for low bitrate aac (for instance with aac-HE)
When I try smth like this

BeSweet.exe -core( -input D:\1\1.wav -output D:\1\ -6ch )
BeSweet don't support WAVE_FORMAT_EXTENSIBLE and int wav >2GB

Livesms
22nd December 2006, 13:50
aacDECdrop produce a wrong channelmapped wav (C,FL,FR,SL,SR,LFE), must be FL,FR,C,LFE,SL,SR. Also the samplerate is half than original for low bitrate aac (for instance with aac-HE)

BeSweet don't support WAVE_FORMAT_EXTENSIBLE and int wav >2GB

aacDECdrop prodused me a 6ch wav file, which I splited to 6 mono with besplit -core( -input 1.wav -prefix mono -demux -type wav )
Then Winhex script was applied.
If I will open it with Sonic Foundry Soft Encode in order of
"mono02.wav" "mono03.wav" "mono01.wav" "mono06.wav" "mono04.wav" "mono05.wav"
Will it be ok? Is it the same result as
faad -o intermediate.wav input.aac
wav2mono intermediate.wav -ignorelength

And what about wav2mono?
Where can I downloader wav2mono - Mytempdir removed file.

tebasuna51
22nd December 2006, 14:05
The AudioFormat in mono wav's produced by BeSplit I think is correct because the wav6 is not WAVE_FORMAT_EXTENSIBLE.
Check the BlockAlign at 0x20, must be 2 (16 int mono) instead 12.

Your assumed channels are correct.

A temp link to WavUtil_2.zip (http://www.mytempdir.com/1128809)

tebasuna51
22nd December 2006, 14:20
The http://rapidshare.com/files/3572747/WavUtil.zip.html in the mentioned post still work for me.

Sonic Foundry SoftEncode default order is FL,C,FR,SL,SR,LFE then your monowav files must be 02, 01, 03, 04, 05, 06

Moti172
8th October 2007, 22:21
Hi
I tried to follow the instructions above:

Extract the 6ch AAC from MKV with MKVExtractGUI.
Use:
faad -o intermediate.wav input.aac
wav2mono intermediate.wav -ignorelength

I got 6 wav files at the exact same size.
When I tried to play them, it seems that the one with the name BL contain the speech, and the others had low music.

My questions are:
1. Does wav2mono separate the channels in the same order as the files name?
2. Is it possiable that the channels in the AAC file are incorrect? if so, is there away to know what is the most likely possible mistake?
3. Is there any free software to encode the 6ch into AC3?

Thanks

tebasuna51
8th October 2007, 23:35
1. Does wav2mono separate the channels in the same order as the files name?
Nope, the order is:
Channel 1 -> FL (Front Left)
Channel 2 -> FR (Front Right)
Channel 3 -> FC (Front Center)
Channel 4 -> LF (Low Frequency)
Channel 5 -> BL (Back Left)
Channel 6 -> BR (Back Right)

2. Is it possible that the channels in the AAC file are incorrect? if so, is there away to know what is the most likely possible mistake?
If the dialogs (Channel 3 - FC) appear in Channel 5 - BL after Faad (output: MS defaults defined in WAVE_FORMAT_EXTENSIBLE) and Wav2mono the only explanation is the original AAC was wrong mapped.
The ac3 order is (FL-FC-FR-BL-BR-LF) and the internal aac (FC-FL-FR-BL-BR-LF), as you can see the first 3 channels (fronts) can be mistaken but never go to channels 4-5-6 (backs and LF). The error must be a manual mistake.

3. Is there any free software to encode the 6ch into AC3?
Aften is the free encoder to use, but need a unique 6chan wav.
You can use WaveWizard to merge the 6 mono wav's.

Moti172
9th October 2007, 02:14
Thank you for your answers.
It seems that the AAC's channels order was wrong.
:thanks:

naboth
11th December 2007, 03:54
Hello,

First I just want to thank everybody for contributing to this thread, it really helped me with a project I was very excited about. But I've come across a problem with a particular 5.1 aac file, and was wondering if anyone could help.

Using faad as outlined above, I've read that if it gives you an error message, you can know that there is a error with the aac file that faad can't process. Well, I am getting an error message, and I really need to transcode this aac file to ac3, so hopefully somebody can help me with what I need to do to get around this issue.

faad stops decoding around 15% and spits out the error message: "Error: Maximum number of scalefactor bands exceeded."

So is there any way to get around this? Any fix, or another app for decoding the aac to a wav file? TIA!

tebasuna51
11th December 2007, 09:49
You can try with Foobar2000 or any DirectShow decoder (coreaac, ffdshow, ...)

ImAhNoBoDy
28th January 2008, 12:57
I'm trying to do the graphedit way in this guide, but can't get to work. I was able to output to a 6 channel wav file through graphedit but not a 6 channel ac3. I have ffdshow audio configs in the output as follows:

http://img.photobucket.com/albums/v395/SeX1eStAsaBa/Others/ffdshowoutput.jpg

I'm not sure if this is an issue too, but when I check ac3 output ffdshow doesn't show up when I play a wav file. When I have ac3 output turned on, I drag the wav file in graphedit and ffdshow doesn't appear. If I uncheck output for ac3 of course wav and ac3 files are playable. Is this normal? I've tried all kinds of ways but can't get it to work. I know I can get a 6 channel ac3 with virtualdub but I wanted to try it with graphedit.


My graph is as follows:

blah.wav --> wav parser --> ffdshow audio decoder (with ac3 output on)--> filewriter

tebasuna51
28th January 2008, 13:51
I'm trying to do the graphedit way in this guide, but can't get to work. I was able to output to a 6 channel wav file through graphedit but not a 6 channel ac3.
Work for me. Maybe we have different ffdshow version or DS configuration.
If you want encode to ac3 file (not for SPDIF output) don't use ffdshow like encoder (always -6dB low volume) use Aften instead.

ImAhNoBoDy
28th January 2008, 19:40
^darn, we might have different version then. I have ffdshow_rev1734_20071229_xxl. Which version of ffdshow do you have?

I'm pretty sure ac3filter should output to ac3 using graphedit right?

tebasuna51
28th January 2008, 21:13
ffdshow_beta3_rev1324_20070701_clsid

When I check ac3 output, the 16,24, ...bit integer go unchecked (I can't obtain your image)

I don't use Ac3Filter

ImAhNoBoDy
28th January 2008, 22:04
I use xxl's build. I'll see if clsid build works or not. I tried to turn off 16, 24, etc but it seems like one of them NEEDS to be checked. If it works I'll post what I did.

nautilus7
29th January 2008, 14:52
May i ask why do you both use such an old version of ffdshow?

ImAhNoBoDy
30th January 2008, 16:48
Nope, no go. I tried ffdshow_rev1771_20080113_clsid, but whenever I would play a 6 channel wav file it would crash on windows media player...same with graphedit. I don't think this version is capable to play 6 channels cause in the mixer the most is 5 channels showing.

I tried ffdshow_rev1771_20080113_clsid again to see if when pulling up directshow filters in graphedit, it would crash. It did so I tried to version before that which was ffdshow_rev1732_20071228_clsid_sse_icl10 and still unable to get ac3 output. This time 16, 24, etc bits are not on and ffdshow still will not output to ac3.

I guess I'll just stick with virtualdub for now or until I can figure something out.

tebasuna51
30th January 2008, 20:34
I don't think this version is capable to play 6 channels cause in the mixer the most is 5 channels showing.

Really strange.

I guess I'll just stick with virtualdub for now or until I can figure something out.

I don't know how you can use VirtualDub to encode wav -> ac3.

ImAhNoBoDy
31st January 2008, 02:13
Well the audio stream has to be shorter than a random video stream. I'll get like a 2 hour movie, then get a wav source from the audio menu. I then compress it using ac3 acm. Save as wav, and I have a ac3 file. In VirtualdubMod it doesn't work cause it keeps on saying that it can't decompress the audio stream.

Yea I thought it was also strange that you were able to decode the 6 channel audio files with the same version of ffdshow too. Are you also using Haali? Cause I'm not.

Robertus
15th April 2008, 01:29
sorry guys, i have a problem

i try with graphedit but i have this error:

these filter cannot agree on a connection, verify type compatibility of input pin and output pin.

this message, when i try to connect .aac output with ffdshow audio decoder input.

can you help me?

i use the last ffdshow and i set it:
Codecs:

AC3: liba52
AAC: realaac

OUTPUT:

AC3 (SPDIF encode mode) enable

bitrate 448

coonect to any filter
dont use waveform.... enable
allow direct-to-file output enable

please help me :(

tebasuna51
15th April 2008, 09:25
The .aac output is from an .aac file or a splitter?

If is from a file maybe you need an AAC parser.

The target is convert to an .ac3 file or play through SPDIF?

If you want a conversion I suggest you use Foobar2000 or an AviSynth method (BeHappy/SoundOut/Wavi) instead ffdshow.

Robertus
15th April 2008, 18:58
The .aac output is from an .aac file or a splitter?

If is from a file maybe you need an AAC parser.

The target is convert to an .ac3 file or play through SPDIF?

If you want a conversion I suggest you use Foobar2000 or an AviSynth method (BeHappy/SoundOut/Wavi) instead ffdshow.

foobar don't convert in .ac3

another program? or method avysinth?

Robertus
16th April 2008, 00:03
i use nero to convert .aac in .ac3, but i don't know if this .ac3 is fine about quality.

digifruitella
20th April 2008, 20:28
Fast method with ffdshow:

get GraphEdit from: http://www.3ivx.com/download/windows.html look for the link to GraphEdit in the upper right corner.

get new FFDSHOW from: http://www.aziendeassociate.it/cd.asp?dir=/ffdshow download newest version of ffdshow

-install ffdshow
-activate decoding for aac!
-extract graphedit in a folder
-start graphedit
-drag&drop AAC-file in GraphEdit window
-click and remove "default direct sound device"
- click Menu graph->insert new filter->DirectShowFilter->Filewriter and "insert filter", choose filename "convert.ac3"
-right click on ffdshow->properties->output->AC3 and "allow direct-to-file output" and "don't use Waveformatextensible"
-click ok

[see figure 1]

-connect ffdshow filter with the file writer "convert.ac3" filter
-click play to start conversion and wait until its finished

[see figure 2]

If your output stutters it is very likely that your sampling rate is 44KHz and not 48KHz Some soundcard don't output 44KHz over S/PDIF correctly. To solve this, activate the resampler in ffdshow and set it to "Resample if sampling rate below... 48000Hz".

I appreciate your write up, but it's very confusing...

1. "choose filename "convert.ac3""

huh? I get a box popping up getting me to open something, yeah, but where do I FIND this "convert.ac3" file

2. "[see figure 1]

-connect ffdshow filter with the file writer "convert.ac3" filter
-click play to start conversion and wait until its finished"

Absolutely, doesn't make sense, because figure one doesn't show how to do that..

tebasuna51
20th April 2008, 22:14
I appreciate your write up, but it's very confusing...

1. "choose filename "convert.ac3""

huh? I get a box popping up getting me to open something, yeah, but where do I FIND this "convert.ac3" file

If you insist in this method:

FileWriter ask you the name of output file, you don't need find nothing only select the name you want.

2. "[see figure 1]

-connect ffdshow filter with the file writer "convert.ac3" filter
-click play to start conversion and wait until its finished"

Absolutely, doesn't make sense, because figure one doesn't show how to do that..

- Conect filters in GraphEdit is drag (left mouse click and drag) the output pin from one filter to the input pin of the other.

donnyboy
28th April 2008, 10:39
i've done exactly as dictated above and my graphedt keeps crashing no matter what. i recently bought a creative DDTS-100 decoder and have configured AC3/DTS output over SPDIF with AC3 encode mode enabled using the latest FFDShow. my soundcard is a Creative SB Live 24Bit. Can someone tell me whats wrong? Any help will be most appreciated. Thank You:)

tebasuna51
28th April 2008, 13:43
i've done exactly as dictated above and my graphedt keeps crashing no matter what. i recently bought a creative DDTS-100 decoder and have configured AC3/DTS output over SPDIF with AC3 encode mode enabled using the latest FFDShow. my soundcard is a Creative SB Live 24Bit. Can someone tell me whats wrong? Any help will be most appreciated. Thank You:)

This thread is old and a little confuse. Initially was an aac -> ac3 transcode method.

Can you explain your problem? (maybe open a new thread)
Because I don't know for what you need a DDTS-100 decoder and a soundcard Creative SB Live 24Bit.

donnyboy
2nd May 2008, 03:10
This thread is old and a little confuse. Initially was an aac -> ac3 transcode method.

Can you explain your problem? (maybe open a new thread)
Because I don't know for what you need a DDTS-100 decoder and a soundcard Creative SB Live 24Bit.

Well i bought a DDTS-100 for my PS3 and decided to hook it up to my pc when watching 1080p HD movies. You see my pc is a measly 3.0GHz Prescott P4 with 512Mb of RAM and 1080p HD movies really gives it a run for its money even with the CoreAVC codec properly installed and configured. So i decided to stream AC3 through S/PDIF to the DDTS-100 decoder and save CPU usage. That was the whole point behind hooking up my pc and the decoder.

I wanted to convert 6 channel LC AAC to its equivalent AC3 format and whenever i follow the above set of instructions Graphedt always crashes and locks up. Is there anyway to solve this. I have the Dec'07(rev1723) version of FFDShow installed.

tebasuna51
2nd May 2008, 11:14
...So i decided to stream AC3 through S/PDIF to the DDTS-100 decoder and save CPU usage. That was the whole point behind hooking up my pc and the decoder.

I wanted to convert 6 channel LC AAC to its equivalent AC3 format and whenever i follow the above set of instructions Graphedt always crashes and locks up. Is there anyway to solve this. I have the Dec'07(rev1723) version of FFDShow installed.

To transcode aac -> ac3 files, use Foobar2000, BeHappy or Faad-Aften (command line). The GraphEdit-DirectShow filters method is dificult to support because each machine have very different DirectShow configuration.

The ffdshow method to transcode aac -> ac3 on the fly can't save CPU usage because not only need decode the aac but also encode to ac3 with more CPU usage.