Decoding / Encoding .ogg Files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • imported_PanzerSmurf

    #1

    Decoding / Encoding .ogg Files

    I have finally succeeded my attempt to figure out how these damn .ogg files work. DICE took the liberty (unfortunately) to hard code serials into the engine.

    So, to achieve a successful input of new sounds, you need to do the following.

    First and foremost, you are going to need to grab Vorbis' .ogg tools off of this website (the encoder file set). Now, let's get our hands dirty.

    Let's say we wish to replace the M1A2 cockpit ambience with a Panzer's ambience...

    1. First, create your sounds files as always (.wav).
    2. Grab an .ogg file from another tank's cockpit ambience in Battlefield 2. Let's use the default M1A2 .ogg file.

    ...\Objects_client\Vehicles\Land\USTNK_M1A2\Sounds \M1A2_cockpit.ogg

    3. Now, open up your command prompt (Start > Run > cmd)
    4. You should now pinpoint cmd to the location you had installed the Vorbiss tools. In my case, it's C:\Program Files\Vorbis\
    5. Before we continue, we need to obtain the serial number I talked about earlier: type the following into the cmd prompt.

    ogginfo M1A2_cockpit.ogg

    8. It will give you some information at the top that should look like this:

    New logical stream <#1, serial: 00000e9a>

    6. Write the serial number provided (00000e9a) down. You should also pay attention to the "Nominal bitrate" (56.001000), which you should also write down.
    7. We need to convert the Unicode the program spat out into ASCII. To do so, you need to go to this page.
    8. On the page I just provided, you will see the field "Input Base". Set that to "hex or U+xxxx".
    9. In the "Enter Number" field, you are going to type in the serial number you just obtained from the M1A2_cockpit.ogg file (00000e9a).
    10. After that, you simply need to hit the "Process" button.
    11. Once you hit "Process", you will see numbers and letters in the four boxes below. What we want is from the "Dec" field (3738).

    Note: the ASCII should be eight characters long, so keep in mind the webpage is removing the four beginning zeroes. The actual ASCII code is 00003738.

    12. To convert the .wav file into an .ogg file, the formula is as follows (typed into the cmd prompt, of course):

    oggenc -b (bitrate) -s (serial number) (newsound.wav)

    13. So in or case it should read as follows:

    oggenc -b 56.001000 -s 00003738 Panzer_cockpit.wav

    It should start encoding the .wav file.

    14. After the Encoding has completed, you are going to want to make sure the serial numbers and bitrates are the exact same. So type the following into the cmd prompt to double check them:

    ogginfo M1A2_cockpit.ogg
    ogginfo Panzer_cockpit.ogg

    If the serial numbers match, then you have successfully encoded an .ogg file! If you guys have any questions, feel free to ask. I should also note this works with ANY .ogg file, be it ambience or menu / loading music.
  • Harmor

    #2
    Re: Decoding / Encoding .ogg Files

    This looks like we need a little utility to do this.

    Comment

    • imported_PanzerSmurf

      #3
      Re: Decoding / Encoding .ogg Files

      Good idea. I'm currently taking a few classes for programming (VB & C++), so this may actually be my first (public) program to create.

      Comment

      • -(PK)-DarkIllusion

        #4
        Re: Decoding / Encoding .ogg Files

        ........ just use winap .... it plays OGG files
        lol.

        Comment

        • Harmor

          #5
          Re: Decoding / Encoding .ogg Files

          Originally posted by -(PK)-DarkIllusion
          ........ just use winap .... it plays OGG files
          lol.
          He's not showing us how to play an ogg file (we know Winamp plays them). He's showing us how to replace an .ogg file with a .wav file.

          Hopefully we'll have a utility that'll just do this:

          UTILITY file.ogg newfile.wav

          Comment

          • tF-voodoochild

            #6
            Re: Decoding / Encoding .ogg Files

            Wow, even used the exact same web site for the ascii to unicode conversion that I did...

            anyways, http://www.totalbf2.com/forums/showp...7&postcount=15

            Comment

            • ironmonkaa

              #7
              Re: Decoding / Encoding .ogg Files

              is there anyother way to find out wut the serial code is,because that link isn't working for me

              Comment

              • MarkHawk

                #8
                Re: Decoding / Encoding .ogg Files

                damn vorbis link wont work... anywhere else I can gett his file because the one's I have pulled up on google have been nothing but trouble.

                Comment

                • Megaraptor

                  #9
                  Re: Decoding / Encoding .ogg Files

                  I would post them on the forums but they are too big - any other ideas?

                  Comment

                  • MarkHawk

                    #10
                    Re: Decoding / Encoding .ogg Files

                    isn't file front a site the offers free hosting? I could be wrong. Someone will mirror it if you ask... but that doesn't help really

                    Comment

                    • MarkHawk

                      #11
                      Re: Decoding / Encoding .ogg Files

                      around steps 5-8 i get confused.

                      I have a .wav file titled "13 Leave No Man Behind wav.wav" I want this to be my new Menu_music.ogg.

                      I use Esay CD-DA which has the Vorbis tool in it to make .ogg.

                      I have the 2files now. What directory to I place them in to get that seriaL number? When ever I type cmd ogginfo 13 Leave No Man Behind wav.wav or menu_music.ogg i just get some error.

                      When I do type it into the cmd prompt though do I just put ogginfo 13 Leave No Man Behind wav.wav or c:\programs\vorbis\vorbis1.1.1\ogginfo\13 Leave No Man Behind wav.wav

                      I am c onfused and really want to make custom menu music. Please help...

                      Comment

                      • tF-voodoochild

                        #12
                        Re: Decoding / Encoding .ogg Files




                        Comment

                        • ironmonkaa

                          #13
                          Re: Decoding / Encoding .ogg Files

                          thanks

                          Comment

                          • MarkHawk

                            #14
                            Re: Decoding / Encoding .ogg Files

                            Alright since I am doing really bad at this I am going to explain step by step what I am doing and you can tell me what I am doing wrong.

                            Let's say I never heard of vorbis and nothing like it is my computer. No Vorbis folder or anything

                            First I download the 2 files you gave me above. I stick them in a folder on my desktop called "ogg info files"

                            Next I opened up the common_client.zip and found the Menu_music I want to swap. I copy this file and put it on my desktop in a folder called "audio_folder"

                            Next I locate my song I want to replace it with. I have it as a WMA (Windows Media Audio). I open up a program called "Easy CD-DA Extractor" and make 3 version of the song because I do not know which I will need.
                            Leave_no_man_behind.WMA
                            Leave_no_man_behind.WAV
                            Leave_no_man_behind.OGG
                            I stick these in a folder on my desktop labeld "Replacement Music"

                            Now I am ready to do this.
                            From here I am confused. I do not know what folder to drag the 2 files called
                            oggenc.exe
                            ogginfo.exe
                            Into. I decided to leave them in mydesktop folder because I do not know what to do with them.

                            My Music is the same way. I have 3 Formats of the song. Should I make a new folder on the desktop and add the 3 versions with the 2 .exe's i downloaded? And if yes then what will I name that folder and what would the CMD lines be for it?

                            Unfortunitly this is as far as I have gotten. Every time i tried to run CMD prompts it took me nowhere. Just opened folders. Neevr opened up items correctly.

                            Please help me. This I can not figure out.
                            MarkHawk

                            Comment

                            • MarkHawk

                              #15
                              Re: Decoding / Encoding .ogg Files

                              help :-(

                              Comment

                              Working...