## Required Software
### Linux
- Hex editor: `hexedit`, `ghex`, or `bless`
- WAV information tool: `soxi`
- Audio player/DAW: REAPER
### macOS
- Hex editor:
- Hex Fiend (recommended): https://hexfiend.com/
- 0xED: https://www.suavetech.com/0xed/
- WAV information tool:
- `soxi` (install with Homebrew)
```bash
brew install sox
```
- Audio player/DAW: REAPER
## 1. Check the WAV Sample Rate
First, choose a WAV file.
### Linux / macOS
```bash
soxi filename.wav
```
Example output:
```
Sample Rate : 44100
Channels : 2
Precision : 16-bit
```
---
## 2. Open the WAV File in a Hex Editor
Open the WAV file:
### Linux
```bash
hexedit filename.wav
```
### macOS
Open the file with **Hex Fiend**.
---
## 3. Find the Sample Rate Field
A simple PCM WAV file usually stores the sample rate at:
```
0x18
```
However, WAV files use a chunk structure, so extra chunks may exist before the `fmt ` chunk.
If you do not find the sample rate at `0x18`:
1. Search for:
```
66 6D 74 20
```
which represents:
```
"fmt "
```
2. The sample rate is located 12 bytes after the beginning of the `fmt ` chunk.
Example:
```
fmt chunk:
fmt (4 bytes)
size (4 bytes)
format (2 bytes)
channels (2 bytes)
sample rate (4 bytes) <-- here
```
---
## 4. Understand Little-Endian
WAV uses **little-endian** byte order for numbers.
Example:
```
44100 Hz
```
Hexadecimal:
```
AC 44
```
Big-endian representation:
```
AC 44
```
WAV stores it reversed:
```
44 AC
```
because WAV uses little-endian.
---
## 5. Change the Sample Rate
For example, change:
```
44100 Hz → 22050 Hz
```
Original:
```
44100 = AC 44 (big-endian)
```
Stored in WAV:
```
44 AC
```
Replace:
```
44 AC
```
with:
```
22 56
```
because:
```
22050 = 56 22 (big-endian)
```
and WAV stores it as:
```
22 56 (little-endian)
```
Save the file.
---
## 6. Check the Result
Run:
```bash
soxi filename.wav
```
You should now see:
```
Sample Rate : 22050
```
---
## 7. Listen to the Result
Import the edited WAV file into REAPER.
The file duration will appear approximately **twice as long**, and playback will sound:
- slower
- lower in pitch
because the audio samples are unchanged, but the player now interprets them as **22050 samples per second instead of 44100 samples per second**.
This experiment demonstrates that the WAV header controls how audio data is interpreted; the actual waveform samples are not modified.