summaryrefslogtreecommitdiff
path: root/HOWTO.md
blob: 6a4d723192f8e6479e1acc8b88c3597ca41d95e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# How To

This document describes the common commands for building and testing the project.

## Features

*   **Real-time Audio Synthesis**: The demo features a multi-voice synthesizer that generates audio in real-time from spectrograms.
*   **Dynamic Sound Updates**: Spectrograms can be updated dynamically and safely during runtime for evolving soundscapes.

## Building

### Debug Build

```bash
cmake -S . -B build
cmake --build build
```

### Size-Optimized Build

```bash
cmake -S . -B build -DDEMO_SIZE_OPT=ON
cmake --build build
```

## Testing

To build and run the tests, you need to enable the `DEMO_BUILD_TESTS` option in CMake.

Available test suites:
*   `HammingWindowTest`: Verifies the properties of the Hamming window function.
*   `SynthEngineTest`: Verifies the core functionality of the audio synthesizer.

```bash
cmake -S . -B build -DDEMO_BUILD_TESTS=ON
cmake --build build
cd build
ctest
cd ..
```

## Tools

### Spectrogram Tool (`spectool`)

A command-line tool for analyzing WAV and MP3 files into spectrograms and playing them back.

#### Building the Tool

To build `spectool`, you need to enable the `DEMO_BUILD_TOOLS` option in CMake.

```bash
cmake -S . -B build -DDEMO_BUILD_TOOLS=ON
cmake --build build
```
The executable will be located at `build/spectool`.

#### Usage

**Analyze an audio file:**
```bash
./build/spectool analyze path/to/input.wav path/to/output.spec
# or
./build/spectool analyze path/to/input.mp3 path/to/output.spec
```

**Play a spectrogram file:**
```bash
./build/spectool play path/to/input.spec
```