Need help decoding .raw audio files from an old horse riding game

Hello!
There is an old game called The Saddle Club. My friend has been trying to decode the audio files, signed 8bit and signed 24bit stereo makes something that is almost correct to the music heard in-game. Signed 16bit causes white noise.
This is the game: https://youtube.com/playlist?list=PLv7kwtShWEOjPd0iRXIza-DSfNUh61pME&si=pmbsd0dGOyjDII2P
I’ll attach the soundtrack for anyone who may have an idea.
The Saddle Club music ZIP archive on mega.nz


One channel looks fine (but it’s not) and the other is white noise.

Try importing as Signed 16-bit mono with Big-Endian byte order. I’m not sure what the sample rate is but I imported intro.raw at 44,100 Hz with those settings, and it sounds like music.

But wait! There’s more! I switched to Spectrogram and noticed discontinuities every 4096 samples. So I speculate that it really is stereo but interleaved every 4096 samples–that is, it stores 4096 samples for the left and then 4096 samples for the right and then repeat back to the left. Most PCM formats alternate every other sample (1 sample left, 1 sample right, repeat), but this raw format seems to be a little… weird.

Edit: I’m sure someone could whip up a Nyquist script to sort out the left and right samples to see if it sounds more correct.

If you can play the audio from the game it would be easier to record it as it’s playing. :wink:

I’m a C guy so here’s a little C program I wrote that converts a raw file to little-endian signed 16-bit stereo:

#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <limits.h>

// write Little-Endian
static bool putSample(FILE *f, int s)
{
	return fputc((s & 0x00ff) >> 0, f) >= 0 &&
	       fputc((s & 0xff00) >> 8, f) >= 0;
}

#define SAMPLE_EOF LONG_MAX

// read Big-Endian
static long getSample(FILE *f)
{
	int s = 0;
	int c;
	c = fgetc(f);
	s = c << 8;
	c = fgetc(f);
	if (c < 0) {
		return SAMPLE_EOF;
	}
	s |= c;
	return s;
}

static size_t getSamples(FILE *f, int samples[], size_t n)
{
	for (size_t i = 0; i < n; ++i) {
		long s = getSample(f);
		if (s == SAMPLE_EOF) {
			return i;
		}
		samples[i] = s;
	}
	return n;
}

#define N 4096

int main()
{
	int samples[2][N];

	while (getSamples(stdin, &samples[0][0], N) == N &&
	       getSamples(stdin, &samples[1][0], N) == N) {
		for (int i = 0; i < N; ++i) {
			putSample(stdout, samples[0][i]);
			putSample(stdout, samples[1][i]);
		}
	}

	return 0;
}

I can’t guarantee that it’s actually correct, but all of them sound OK at a 22,050 Hz sample rate.

@gta_npc here’s the decoded files (as little-endian signed 16-bit stereo): https://drive.google.com/drive/folders/1iLM6yMXtqIE0DCNyqOHH5IG8SWOwk1eE?usp=drive_link

I’m not sure if they should be 22,050 Hz or 24,000 Hz (or possibly some other sample rate). Both of those are common sample rates. If you pick the wrong one the music will sound a little flat or sharp (by about 1.5 semitones), so you’ll need to experiment with that.

Thank you so much! I’ve also seen the script- really, thank you so much for helping!

update: it seems to be 32000Hz!

We’ve noticed some clicking in the music, mainly in like the first 8 seconds. Do you know what could be causing the clicking in the left channel? In some tracks like the forest theme the clicking sometimes seems to be in both channels
Here’s the converted files;
Sign in to your account

Interesting. I just listened to the forest theme with good headphones, and I couldn’t hear any clicking at all. The first 5 or 6 seconds is a reverse cymbal, then the music starts and sounds pretty clean to me. Could it be your playback system?

This topic was automatically closed after 30 days. New replies are no longer allowed.