Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Raw PCM to Wave PCM manual

Featured Replies

  • Author
  • Localization

spider91, posted Sun Oct 19, 2014 12:25 am (1029)


Is there any manual of restoring raw pcm headers on files? I've found a lot info about wave headers, but nothing that can help to restore headers on raw data. Also i'd like to make a raw pcm scanner for game files to rip raw data from them, but dunno how to recognize it without headers.
  • Author
  • Localization

aluigi, posted Sun Oct 19, 2014 7:15 am (1035)


Without information about frequency, channels and bits, you cannot retrieve them from the raw stream.
The only thing you can guess with some big luck are the bits, 8 or 16.
And regarding the scanner, same problem. There is not a single signature to search for a scanning, to get both beginning and end of the raw data.
  • Author
  • Localization

spider91, posted Sun Oct 19, 2014 7:31 am (1039)


So how does this tool work? It's for compression, but it searches raw data by 2 differenet ways and adds headers to compress it with TAK. I've tried to cut headers on two files, compressed them with this tool and than extracted .tak files from archieve. Files have different crc, but sound is the same.

https://mega.co.nz/#!hoQAEC7Q!LyOLXMSZh ... SAohBosSh0
  • Author
  • Localization

aluigi, posted Sun Oct 19, 2014 7:41 am (1040)


In fact it doesn't work.
I took a PCM WAV file, removed the header ("data" 4) and then added one file before and after it.
It found nothing and this is correct because normally it searches for DDS, WAV, BMP and MP3, and if you enable the -raw option (1 and 2) it will just dump the file from the beginning.
  • Author
  • Localization

spider91, posted Sun Oct 19, 2014 8:02 am (1042)


It dumps whole file because its a compressor. Search for TAK header (tBaK) on dumped file and yo'll see that raw blocks were compressed with TAK (that cant compress files without headers) and if you rip it from there you can listen that sound. Also tool is not perfect and sometimes finds false-positive raw blocks, but the most important that it finds good blocks and restrores their headers.
  • Author
  • Localization

spider91, posted Tue Oct 21, 2014 4:05 pm (1113)


aluigi wrote:
I made a test and that tool didn't work with me.
The reason is logic, go on Linux and make: cat /dev/urandom > /tmp/audio_data.raw

The generated file can be a sequence of random bytes or just a "noisy" PCM 8 or 16bit raw audio file, nobody can tell or maybe a valid PCM raw in the middle of other non-audio data.

That's the reason why it's not possible to find headerless raw PCM audio data (no RIFF, no other magic signatures to search) in a file, and I already tested the tool and it failed.

I want to be sure that we are in sync on the correct terms, with PCM raw data I mean just the sequence of audio without headers.
If the data has an header then it's a format (RIFF WAV for example) and, yes, in that case it's possible to search the files, but it's a format scanner and not a "raw" scanner.

Hope it's clear now.


Ok, lets forget abou scanner and talk about already extracted and splitted raw pcm from the game. this tool restores headers and compresses that files with TAK. for now i need to compress each raw file with that tool, than cut first bytes until tBaK (magic of TAK format) and decode it to normal wave pcm. not very comfortable algo.... so i'd like to discover tha way that tool restores headers on raw files. Any suggestions?
  • Author
  • Localization

aluigi, posted Tue Oct 21, 2014 4:13 pm (1114)


That's easy.
Basically you need only to know the frequency, the channels and the bits.
Usually they are 44100, 2 and 16.

Exist various ways to add the RIFF WAV header, many years ago I wrote a simple tool for the job:
http://aluigi.altervista.org/testz.htm#wavehead

Example:
Code:
wavehead input.raw output.wav 44100 2 16 1

There are also various quickbms scripts online to "play" with raw data and headers, AlphaTwentyThree made many of them.
  • Author
  • Localization

spider91, posted Tue Oct 21, 2014 7:25 pm (1117)


Hmm you was right. That tool adds standard frequency and files are too quick or too slow if its different from 44100. But, somehow, that tool detects number of channels by scanning raw data. Which is the way to detect them?
  • Author
  • Localization

spider91, posted Tue Oct 21, 2014 9:34 pm (1123)


He's busy and not responding.
  • Author
  • Localization

ARA-JediMaster1138, posted Thu Mar 26, 2015 4:26 am (4105)


Excuse me, but I want to relay this message for help for iteachvader. He is trying to get the sound effects from "Star Wars: Rogue Squadron II: Rogue Leader" and "Rogue Squadron III: Rebel Strike" with little success. Here is the thread on Dolphin forums where he is having trouble: https://forums.dolphin-emu.org/Thread-s ... g-features
https://forums.dolphin-emu.org/Thread-s ... res?page=8. Anybody out there who can help him? I hope that this would be the right thread to put up the link on, he is having difficultly decoding the .dat files containing the sounds into .wav files.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.