Post by giftfish on Jan 5, 2017 20:00:33 GMT
Ported from the old forum with formatting changes for readability. Highlights only, due to thread length, and broken up into multiple posts.
PART 1 : INITIAL IDEA
New(ish) Tool | Audio Editor
Postby giftfish » 13 Sep 2016, 16:03
Placing new audio in the game is a royal pain in the ass and requires a LOT of different tools.
Here's the current workflow:
1. Extract game audio using different programs, depending on the game and how much audio you want extracted (Gibbed's, Kyp's, ME3Exp Audio Extractor, Soundplorer)
2. Edit sound files in Audacity/audio editor
3. Convert sound files in Wwise
4. Use Fob's AFC Creator to build a new AFC; use a text editor to keep track of the new lengths and offsets in the new AFC
5. Add new AFC to name list in PackEd
6. Repoint exports to new AFC in PackEd
7. Hex edit export references to WAV length and offsets in new AFC in PackEd
8. Use WwiseBankEditor to hunt down edit bank hex, if necessary (lots of fun there)
9. Test in game
10. Do all of this all over again when the line doesn't test well in game
11. Do all of this for every line you want to replace
Yeeeeah. It sucks. Pretty hard. It's incredibly tedious and time consuming. ME3 is frequently uncooperative, as the game engine changes what the audio sounds like. So, something that is perfect in Audacity and Wwise, might end up sounding less perfect in game. In short, there is lots of trial and error involved. At least for dialogue. If you have to add SFX to the audio (like a drell voice that you have to match to existing lines), boy, you're really asking for trouble.
We can't do anything about Wwise and Audacity. But, we can streamline ALL the rest of this. By a lot. In a new "Audio Editor". It'll require a new GUI, which... yeah, I'll get on that. It'll also require we finish and expand the current feature set of all these tools.
Btw, Deager and I will likely be so excited about this we'll crap out some kittens. Really. This is on the level of the FaceFX Editor.
Github issue here.
Postby SirCxyrtyx » 14 Sep 2016, 10:48
I'd love to make the whole audio workflow better. Stuff like dealing with AFCs and offsets would majorly benefit from the tool doing it for you.
I've heard of this fabled AFC creator of Fob's, but I don't think I've ever seen it. It doesn't appear to be on the third-party utilities board.
Postby The Fob » 19 Sep 2016, 20:31
sircxyrtyx: If you feel like making a tool out of this simple command line prog, that'd be great!
The code is really simple, so it should it'll probably take you about 30 seconds to transfer it.
Postby SirCxyrtyx » 19 Sep 2016, 20:41
Something to keep in mind is that some sounds are pcc-stored. A direct-replacement option would be necessary for those, at the very least.
Postby giftfish » 20 Sep 2016, 04:20
This I did not know, so thanks for clarifying
The replacement method actually should no longer matter as far as the GUI workflow I came up with last night. However, if we allow replacement within vanilla AFCs we either need to change how that works behind the scenes so that size isn't an issue, or we need to have it work under different constraints than a non-vanilla AFC and not allow the replacement unless it's within the vanilla size range.
I have no idea how sound replacement within PCCs works and if the toolset even supports it. Assuming that the sound is concatenated to the end of the file, then in theory, I think the modder could use whatever file size they need to.
Postby Deager » 20 Sep 2016, 06:14
Not sure if this is answered later in the thread and I don't know about afc stuff in the base game. Theoretically, yes, it would work...I think. But I think we really need people to get used to DLC mods since they are massively malleable and, I think, much better for the end user.
Postby giftfish » 20 Sep 2016, 06:23
The new DLC Mod Generator we'll be making should help substantially.
Also, Sir pointed out that some sounds are PCC-stored, which I didn't know. So, it looks like we'll need to retain the functionality, but hopefully we can improve on it. For example, from what I understand, the reason we need to stay within the same size range for vanilla AFCs, is b/c the hex pointers don't get changed. We're literally swapping out the bytes in the same area of the file, which is why we have to keep the sound the same length and size. Why not change this so that the new sound is concatenated to the end of the AFC and then the hex is adjusted and the file name repointed, just like when generating a new AFC?
Is there some reason why this method was never put into Soundplorer that I'm missing? >.> Music has it's own complications with the banks, which is something else we'll address, but for dialogue, I can't see why this method wouldn't work.
Postby Deager » 20 Sep 2016, 07:06
The history on that issue with moving new sounds to the end was we didn't have the dll fix. So, anytime we had a file larger than the original, we borked the game and it wouldn't authorize or load. But if we kept file sizes the same or smaller, we could get stuff done.
Now of course we have the dll thing so that limitation got lifted. That's my understanding of it anyway. And I only worked with the Citadel DLC back then so I'm not sure what core game stuff did.
Postby The Fob » 21 Sep 2016, 08:19
deager -- That makes some sense. The DLL fix wasn't needed for base game files, though, so that's a bit weird.
IIRC, the main problem really was that it took us a while to figure out how/where to exchange the HEX in the pcc files, that indicates offset/length of the sounds. So when we did this for the very first time, we tried to keep everything as it was as much as possible and just change bytes.
deager/Fob/JohnP -- You guys have also done lots of audio work. Please let me know if there's any UI elements or functionality you want to see.
So, one thing I really got used to was to work with batch files that call AFC creator commands. It's great because it saves your work procedure, rather then the result only. You can save your replacements in a .bat file and do as many modifications to the original files as you like with just one command/click, while not modifying the original file at all. If you want to change some of your edits later, you just need to change one line in the bat file and run it again, rather then work out what's where in the new afc file again.
If we could implement batch execution and saving or something similar in the new tool, that would be perfect.
Next Post: Part II
PART 1 : INITIAL IDEA
New(ish) Tool | Audio Editor
Postby giftfish » 13 Sep 2016, 16:03
Placing new audio in the game is a royal pain in the ass and requires a LOT of different tools.
Here's the current workflow:
1. Extract game audio using different programs, depending on the game and how much audio you want extracted (Gibbed's, Kyp's, ME3Exp Audio Extractor, Soundplorer)
2. Edit sound files in Audacity/audio editor
3. Convert sound files in Wwise
4. Use Fob's AFC Creator to build a new AFC; use a text editor to keep track of the new lengths and offsets in the new AFC
5. Add new AFC to name list in PackEd
6. Repoint exports to new AFC in PackEd
7. Hex edit export references to WAV length and offsets in new AFC in PackEd
8. Use WwiseBankEditor to hunt down edit bank hex, if necessary (lots of fun there)
9. Test in game
10. Do all of this all over again when the line doesn't test well in game
11. Do all of this for every line you want to replace
Yeeeeah. It sucks. Pretty hard. It's incredibly tedious and time consuming. ME3 is frequently uncooperative, as the game engine changes what the audio sounds like. So, something that is perfect in Audacity and Wwise, might end up sounding less perfect in game. In short, there is lots of trial and error involved. At least for dialogue. If you have to add SFX to the audio (like a drell voice that you have to match to existing lines), boy, you're really asking for trouble.
We can't do anything about Wwise and Audacity. But, we can streamline ALL the rest of this. By a lot. In a new "Audio Editor". It'll require a new GUI, which... yeah, I'll get on that. It'll also require we finish and expand the current feature set of all these tools.
Btw, Deager and I will likely be so excited about this we'll crap out some kittens. Really. This is on the level of the FaceFX Editor.
Github issue here.
Postby SirCxyrtyx » 14 Sep 2016, 10:48
I'd love to make the whole audio workflow better. Stuff like dealing with AFCs and offsets would majorly benefit from the tool doing it for you.
I've heard of this fabled AFC creator of Fob's, but I don't think I've ever seen it. It doesn't appear to be on the third-party utilities board.
Postby The Fob » 19 Sep 2016, 20:31
sircxyrtyx: If you feel like making a tool out of this simple command line prog, that'd be great!
The code is really simple, so it should it'll probably take you about 30 seconds to transfer it.

Postby SirCxyrtyx » 19 Sep 2016, 20:41
giftfish wrote:
A more general question: I'm thinking we can probably remove the functionality of replacing WAVs via Soundplorers Import/Export/Direct AFC replace methods? Since folks should be putting new audio into new AFCs, instead?
A more general question: I'm thinking we can probably remove the functionality of replacing WAVs via Soundplorers Import/Export/Direct AFC replace methods? Since folks should be putting new audio into new AFCs, instead?
Something to keep in mind is that some sounds are pcc-stored. A direct-replacement option would be necessary for those, at the very least.
Postby giftfish » 20 Sep 2016, 04:20
SirCxyrtyx wrote:
Something to keep in mind is that some sounds are pcc-stored. A direct-replacement option would be necessary for those, at the very least.
Something to keep in mind is that some sounds are pcc-stored. A direct-replacement option would be necessary for those, at the very least.
This I did not know, so thanks for clarifying

The replacement method actually should no longer matter as far as the GUI workflow I came up with last night. However, if we allow replacement within vanilla AFCs we either need to change how that works behind the scenes so that size isn't an issue, or we need to have it work under different constraints than a non-vanilla AFC and not allow the replacement unless it's within the vanilla size range.
I have no idea how sound replacement within PCCs works and if the toolset even supports it. Assuming that the sound is concatenated to the end of the file, then in theory, I think the modder could use whatever file size they need to.
Postby Deager » 20 Sep 2016, 06:14
giftfish wrote:
A more general question: I'm thinking we can probably remove the functionality of replacing WAVs via Soundplorers Import/Export/Direct AFC replace methods? Since folks should be putting new audio into new AFCs, instead? Allows them to keep the quality significantly better and to not overwrite a vanilla AFC. Anyone know if new AFCs will work in the base game Cooked? If the modder for some reason doesn't want to use a DLC mod?
A more general question: I'm thinking we can probably remove the functionality of replacing WAVs via Soundplorers Import/Export/Direct AFC replace methods? Since folks should be putting new audio into new AFCs, instead? Allows them to keep the quality significantly better and to not overwrite a vanilla AFC. Anyone know if new AFCs will work in the base game Cooked? If the modder for some reason doesn't want to use a DLC mod?
Not sure if this is answered later in the thread and I don't know about afc stuff in the base game. Theoretically, yes, it would work...I think. But I think we really need people to get used to DLC mods since they are massively malleable and, I think, much better for the end user.
Postby giftfish » 20 Sep 2016, 06:23
Deager wrote:
Not sure if this is answered later in the thread and I don't know about afc stuff in the base game. Theoretically, yes, it would work...I think. But I think we really need people to get used to DLC mods since they are massively malleable and, I think, much better for the end user.
Not sure if this is answered later in the thread and I don't know about afc stuff in the base game. Theoretically, yes, it would work...I think. But I think we really need people to get used to DLC mods since they are massively malleable and, I think, much better for the end user.
The new DLC Mod Generator we'll be making should help substantially.
Also, Sir pointed out that some sounds are PCC-stored, which I didn't know. So, it looks like we'll need to retain the functionality, but hopefully we can improve on it. For example, from what I understand, the reason we need to stay within the same size range for vanilla AFCs, is b/c the hex pointers don't get changed. We're literally swapping out the bytes in the same area of the file, which is why we have to keep the sound the same length and size. Why not change this so that the new sound is concatenated to the end of the AFC and then the hex is adjusted and the file name repointed, just like when generating a new AFC?
Is there some reason why this method was never put into Soundplorer that I'm missing? >.> Music has it's own complications with the banks, which is something else we'll address, but for dialogue, I can't see why this method wouldn't work.
Postby Deager » 20 Sep 2016, 07:06
The history on that issue with moving new sounds to the end was we didn't have the dll fix. So, anytime we had a file larger than the original, we borked the game and it wouldn't authorize or load. But if we kept file sizes the same or smaller, we could get stuff done.
Now of course we have the dll thing so that limitation got lifted. That's my understanding of it anyway. And I only worked with the Citadel DLC back then so I'm not sure what core game stuff did.
Postby The Fob » 21 Sep 2016, 08:19
deager -- That makes some sense. The DLL fix wasn't needed for base game files, though, so that's a bit weird.
IIRC, the main problem really was that it took us a while to figure out how/where to exchange the HEX in the pcc files, that indicates offset/length of the sounds. So when we did this for the very first time, we tried to keep everything as it was as much as possible and just change bytes.
deager/Fob/JohnP -- You guys have also done lots of audio work. Please let me know if there's any UI elements or functionality you want to see.
So, one thing I really got used to was to work with batch files that call AFC creator commands. It's great because it saves your work procedure, rather then the result only. You can save your replacements in a .bat file and do as many modifications to the original files as you like with just one command/click, while not modifying the original file at all. If you want to change some of your edits later, you just need to change one line in the bat file and run it again, rather then work out what's where in the new afc file again.
If we could implement batch execution and saving or something similar in the new tool, that would be perfect.
Next Post: Part II