Thread: #167 osrs sound effects dumped (wav format)

Page 1 of 3 123 LastLast
Results 1 to 10 of 27
  1. #1 #167 osrs sound effects dumped (wav format) 
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Contains 3,899 sound effects from index 4 osrs

    OSRS Sound Effect File Format
    • encoding: signed 8-bit PCM
    • sample rate: 22,050 Hz
    • sample bit size: 8
    • channels: 1 (mono)
    • endianness: little-endian


    Download
    sounds

    Here's a few sound ids
    • 97: High Alch
    • 98: Low Alch
    • 200: Modern spell teleport
    • 227: Magic spell splashing
    • 1930: Random event popup
    • 2266: Clicking buttons


    Last edited by CrazyPanda; 04-18-2018 at 02:42 AM.
    Attached image
    Reply With Quote  
     


  2. #2  
    Owner of Ghreborn new and old.


    Join Date
    Nov 2009
    Posts
    916
    Thanks given
    47
    Thanks received
    155
    Rep Power
    273
    Omg ty
    Im back and working on reborn,
    Reply With Quote  
     

  3. #3  
    🖤Runic Developer🖤
    Castiel's Avatar
    Join Date
    Apr 2013
    Posts
    1,752
    Thanks given
    564
    Thanks received
    288
    Rep Power
    609
    my man i love you
    Reply With Quote  
     

  4. #4  
    Owner of Ghreborn new and old.


    Join Date
    Nov 2009
    Posts
    916
    Thanks given
    47
    Thanks received
    155
    Rep Power
    273
    1525.wav is missing
    Im back and working on reborn,
    Reply With Quote  
     

  5. #5  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Quote Originally Posted by Sgsrocks View Post
    1525.wav is missing
    Those files are empty, they probably deleted the files since they are no longer using them. I'm sure they can be found in earlier revisions though.

    This is the list of empty files.

    Code:
    file: 1525 size=0
    file: 1526 size=0
    file: 1943 size=0
    file: 1944 size=0
    file: 1945 size=0
    file: 1946 size=0
    file: 1947 size=0
    file: 1948 size=0
    file: 1949 size=0
    file: 1950 size=0
    file: 1951 size=0
    file: 3229 size=0
    file: 3230 size=0
    file: 3231 size=0
    file: 3232 size=0
    file: 3233 size=0
    file: 3234 size=0
    file: 3235 size=0
    file: 3286 size=0
    file: 3288 size=0
    file: 3289 size=0
    file: 3290 size=0
    file: 3291 size=0
    file: 3293 size=0
    file: 3294 size=0
    file: 3539 size=0
    file: 3540 size=0
    file: 3541 size=0
    file: 3542 size=0
    file: 3543 size=0
    file: 3544 size=0
    file: 3545 size=0
    file: 3546 size=0
    file: 3547 size=0
    file: 3548 size=0
    file: 3549 size=0
    file: 3550 size=0
    file: 3931 size=0
    file: 3932 size=0
    file: 3933 size=0
    file: 3934 size=0
    file: 3935 size=0
    file: 3936 size=0
    Last edited by CrazyPanda; 04-04-2018 at 04:14 AM.
    Attached image
    Reply With Quote  
     

  6. #6  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Impressive, good job. It would be even more beneficial to the community if you released a small tutorial on how you did it. I'm sure a lot of scrubs out there would be pleased. Give a man a fi...you know the rest.
    Reply With Quote  
     

  7. Thankful users:


  8. #7  
    Owner of Ghreborn new and old.


    Join Date
    Nov 2009
    Posts
    916
    Thanks given
    47
    Thanks received
    155
    Rep Power
    273
    this works but it sounds weird https://pastebin.com/vFkVrAGZ
    Im back and working on reborn,
    Reply With Quote  
     

  9. #8  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Quote Originally Posted by Sgsrocks View Post
    this works but it sounds weird https://pastebin.com/vFkVrAGZ
    Sounds weird because it's not in the right encoding. Mine is.

    Quote Originally Posted by Jason View Post
    Impressive, good job. It would be even more beneficial to the community if you released a small tutorial on how you did it. I'm sure a lot of scrubs out there would be pleased. Give a man a fi...you know the rest.
    Basically what I did was...

    Used RuneLite and added a print statement in this method to print var1 and var2. Logged into RuneScape with RuneLite using my account.
    https://github.com/runelite/runelite...fect.java#L128

    var1 is the sound id, var2 seems to only print 0 so if you look further you'll see its a child file which none of these sounds have a child so its 0 https://github.com/runelite/runelite...Base.java#L248

    This is how you'll easily identify the sounds btw
    Code:
    sound: 3141 0
    sound: 3141 0
    sound: 2274 0
    sound: 3141 0
    sound: 2266 0
    sound: 2266 0
    sound: 2266 0
    sound: 2266 0
    sound: 2266 0
    sound: 2073 0
    After the sound file is retrieved from the file system jagex calls method2115
    https://github.com/runelite/runelite...ss110.java#L65

    If you go to method2115 you'll see they mix the audio
    https://github.com/runelite/runelite...ffect.java#L47

    22050 is the sample rate in Hz. I know this because the sample rate is already refactored in the RawAudioNode class. https://github.com/runelite/runelite...oNode.java#L25

    After this I exported one of the raw audio files and imported it into audacity as raw audio. audacity automatically detects the encoding as

    signed 8-bit pcm
    little-endian

    I changed the channel to mono channel because 2 channels didn't sound right.
    If you change sample rate to 22050 and play the raw audio (in audacity) it sounds identical to the original sound you can play on any runescape client.

    Attached image

    after knowing the file format then I simply convert to wav format (I'm using OpenRS)

    Code:
        public static void main(String[] args) {
            try (Cache cache = new Cache(FileStore.open(Constants.CACHE_PATH))) {
                File dir = Paths.get("sounds").toFile();
                if (!dir.exists()) {
                    dir.mkdirs();
                }
    
                export(cache, dir, true);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    
        private static void export(Cache cache, File dir, boolean wav) {
            ReferenceTable table = cache.getReferenceTable(CacheIndex.SOUND_EFFECT);
    
            for (int i = 0; i < table.capacity(); i++) {
                try {
                    SoundEffect effect = SoundEffect.decode(cache, i);
    
                    if (effect == null) {
                        continue;
                    }
    
                    // creates the raw audio binary in signed 8-bit PCM
                    byte[] data = effect.mix();
    
                    // converting to wave format
                    if (wav) {
    
                        // used audacity to determine the binary format encoding
                        // 8 comes from the signed 8-bit pcm
                        // 1 for 1 channel (mono)
                        // true means audio format is signed
                        // false means the audio format is not big endian
                        AudioFormat audioFormat = new AudioFormat(22_050, 8, 1, true, false);
    
                        AudioInputStream ais = new AudioInputStream(new ByteArrayInputStream(data), audioFormat, data.length);
    
                        ByteArrayOutputStream bos = new ByteArrayOutputStream();
    
                        AudioSystem.write(ais, AudioFileFormat.Type.WAVE, bos);
    
                        // binary of audio in wav format
                        data = bos.toByteArray();
                    }
    
                    try (FileOutputStream fos = new FileOutputStream(new File(dir, i + (wav ? ".wav" : ".dat")))) {
                        fos.write(data);
                    }
    
                } catch (Exception ex) {
                    System.out.println("error decoding sound: " + i);
                    continue;
                }
    
                System.out.println("decoding sound: " + i);
            }
    
            System.out.println("decoded: " + table.capacity() + " sounds");
        }
    and wallah it works!
    Last edited by CrazyPanda; 04-04-2018 at 03:37 AM.
    Attached image
    Reply With Quote  
     


  10. #9  
    Registered Member

    Join Date
    Oct 2017
    Posts
    649
    Thanks given
    6
    Thanks received
    119
    Rep Power
    161
    thanks
    Reply With Quote  
     

  11. #10  
    Donator


    Join Date
    Dec 2014
    Posts
    369
    Thanks given
    77
    Thanks received
    112
    Rep Power
    164
    Thank you! Btw I don't have SoundEffect class in my OpenRS, did you add it yourself?
    Attached image
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Dumping Sound Effects
    By CrazyPanda in forum Tutorials
    Replies: 4
    Last Post: 06-19-2016, 10:27 AM
  2. Need 317 sound effects (.mp3 or .wav format)
    By snemosdn5 in forum Requests
    Replies: 1
    Last Post: 05-02-2014, 10:07 PM
  3. Replies: 5
    Last Post: 04-02-2008, 04:35 AM
  4. Sound Effects Needed
    By Palidino in forum RS2 Server
    Replies: 6
    Last Post: 10-17-2007, 04:39 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •