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

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

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th February 2005, 19:58   #1  |  Link
Paulcat
Registered User
 
Join Date: Jan 2005
Location: Great White North
Posts: 326
Convert aac to wav to ??? to ac3

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?
Paulcat is offline   Reply With Quote
Old 9th February 2005, 20:06   #2  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,191
with BeSweet....and accessory BeLight. You can choose the "16 bits (six) mono waves" option in WAV tab.
Kurtnoise is offline   Reply With Quote
Old 22nd February 2005, 01:31   #3  |  Link
Sakuya
Registered User
 
Sakuya's Avatar
 
Join Date: Dec 2002
Posts: 218
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?
Sakuya is offline   Reply With Quote
Old 22nd February 2005, 05:00   #4  |  Link
KpeX
Registered User
 
KpeX's Avatar
 
Join Date: Jun 2003
Location: Great Lakes, USA
Posts: 1,433
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.
__________________
KpeX
Audio FAQs: General | BeSweet | SVCD/MP2 | MP3 | Vorbis | AC3 | DTS | AAC
Linux Audio/Video FAQ
KpeX is offline   Reply With Quote
Old 22nd February 2005, 05:09   #5  |  Link
Sakuya
Registered User
 
Sakuya's Avatar
 
Join Date: Dec 2002
Posts: 218
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?

Last edited by Sakuya; 23rd February 2005 at 08:07.
Sakuya is offline   Reply With Quote
Old 23rd February 2005, 12:17   #6  |  Link
violao
Registered User
 
Join Date: Feb 2004
Posts: 252
Quote:
Originally posted by Sakuya
... and then 44100Hz (source samp. rate)
If you want to create DVD you need to resample your audio to 48000.
violao is offline   Reply With Quote
Old 23rd February 2005, 19:59   #7  |  Link
Sakuya
Registered User
 
Sakuya's Avatar
 
Join Date: Dec 2002
Posts: 218
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 is offline   Reply With Quote
Old 24th February 2005, 07:00   #8  |  Link
Sakuya
Registered User
 
Sakuya's Avatar
 
Join Date: Dec 2002
Posts: 218
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"?
Sakuya is offline   Reply With Quote
Old 24th February 2005, 14:00   #9  |  Link
Paulcat
Registered User
 
Join Date: Jan 2005
Location: Great White North
Posts: 326
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 is offline   Reply With Quote
Old 25th February 2005, 01:30   #10  |  Link
Paulcat
Registered User
 
Join Date: Jan 2005
Location: Great White North
Posts: 326
Quote:
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.
Paulcat is offline   Reply With Quote
Old 25th February 2005, 04:05   #11  |  Link
Sakuya
Registered User
 
Sakuya's Avatar
 
Join Date: Dec 2002
Posts: 218
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?
Sakuya is offline   Reply With Quote
Old 25th February 2005, 04:56   #12  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
@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).
tebasuna51 is offline   Reply With Quote
Old 25th February 2005, 05:12   #13  |  Link
Sakuya
Registered User
 
Sakuya's Avatar
 
Join Date: Dec 2002
Posts: 218
I got WinHex (trial) and I created a script exactly like this:
Code:
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:

Code:
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.

Last edited by Sakuya; 25th February 2005 at 06:43.
Sakuya is offline   Reply With Quote
Old 25th February 2005, 13:50   #14  |  Link
Paulcat
Registered User
 
Join Date: Jan 2005
Location: Great White North
Posts: 326
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...

Last edited by Paulcat; 25th February 2005 at 16:27.
Paulcat is offline   Reply With Quote
Old 25th February 2005, 14:01   #15  |  Link
Paulcat
Registered User
 
Join Date: Jan 2005
Location: Great White North
Posts: 326
Quote:
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?
Paulcat is offline   Reply With Quote
Old 25th February 2005, 18:09   #16  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
@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.
tebasuna51 is offline   Reply With Quote
Old 26th February 2005, 03:10   #17  |  Link
Sakuya
Registered User
 
Sakuya's Avatar
 
Join Date: Dec 2002
Posts: 218
@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.

Last edited by Sakuya; 26th February 2005 at 05:09.
Sakuya is offline   Reply With Quote
Old 26th February 2005, 13:00   #18  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
@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.

Last edited by tebasuna51; 27th February 2005 at 22:41.
tebasuna51 is offline   Reply With Quote
Old 26th February 2005, 17:32   #19  |  Link
Paulcat
Registered User
 
Join Date: Jan 2005
Location: Great White North
Posts: 326
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!
Paulcat is offline   Reply With Quote
Old 26th February 2005, 22:47   #20  |  Link
Sakuya
Registered User
 
Sakuya's Avatar
 
Join Date: Dec 2002
Posts: 218
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.

Last edited by Sakuya; 27th February 2005 at 07:42.
Sakuya is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Forum Jump


All times are GMT +1. The time now is 03:50.


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