Skip to content

Commit 01b51ad

Browse files
committed
add README
1 parent b96c210 commit 01b51ad

File tree

4 files changed

+216
-3
lines changed

4 files changed

+216
-3
lines changed

README.md

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,107 @@
1-
# AudioSpectrum
1+
# AudioSpectrogram
2+
3+
AudioSpectrogram is a powerful audio spectrogram generator that supports various audio formats and produces high-quality spectrograms. Built with Rust, it offers cross-platform support and runs on Windows, macOS, and Linux.
4+
5+
## Features
6+
7+
- Cross-platform support (Windows, macOS, Linux)
8+
- Drag-and-drop support on Windows
9+
- Multiple audio format support: WAV, MP3, FLAC, OGG, AAC, etc.
10+
- High-quality spectrogram generation using Turbo colormap
11+
- Automatic multi-channel audio processing (mixed to mono)
12+
- Precise time and frequency scales
13+
- Complete dB scale display (-120dB to 0dB)
14+
- Customizable FFT size and hop size
15+
16+
## Sample Spectrogram
17+
18+
![Sample Spectrogram](resources/sample-spectrogram.jpg)
19+
20+
This is a sample spectrogram generated using our tool, showing OneRepublic's "Apologize" (44.1kHz sampling rate). The spectrogram clearly demonstrates:
21+
22+
- Full frequency range (0-22.05kHz)
23+
- Clear time axis markers
24+
- Precise frequency scaling
25+
- Rich dynamic range display (-120dB to 0dB)
26+
27+
## Requirements
28+
29+
- Rust toolchain (recommended installation via [rustup](https://rustup.rs/))
30+
- Cargo (Rust package manager, included with Rust)
31+
- System requires at least one monospace font:
32+
- Windows: Consolas
33+
- macOS: Monaco
34+
- Linux: DejaVu Sans Mono
35+
36+
## Building
37+
38+
1. Clone the repository:
39+
40+
```bash
41+
git clone https://github.com/lmshao/AudioSpectrogram.git
42+
cd AudioSpectrogram
43+
```
44+
45+
2. Build the project:
46+
47+
```bash
48+
cargo build --release
49+
```
50+
51+
The executable will be available in the `target/release` directory.
52+
53+
## Usage
54+
55+
Basic usage:
56+
57+
```bash
58+
AudioSpectrogram -i input.mp3
59+
```
60+
61+
On Windows, you can simply drag and drop an audio file onto the program icon, and it will automatically generate a spectrogram. This is the easiest way to use the program.
62+
63+
Alternatively, specify the file directly in the command line:
64+
65+
```bash
66+
AudioSpectrogram input.mp3
67+
```
68+
69+
### Command Line Arguments
70+
71+
- `-i, --input <FILE>`: Input audio file path
72+
- `-o, --output <FILE>`: Output image path (optional, defaults to input filename with .png extension)
73+
- `-f, --fft-size <SIZE>`: FFT size (optional, default: 4096)
74+
- `-p, --hop-size <SIZE>`: Hop size (optional, default: half of FFT size)
75+
76+
### Examples
77+
78+
1. Generate spectrogram with default parameters:
79+
80+
```bash
81+
AudioSpectrogram -i music.flac
82+
```
83+
84+
2. Specify output filename:
85+
86+
```bash
87+
AudioSpectrogram -i music.flac -o spectrum.png
88+
```
89+
90+
3. Custom FFT parameters:
91+
92+
```bash
93+
AudioSpectrogram -i music.flac -f 8192 -p 2048
94+
```
95+
96+
### Output Description
97+
98+
The generated spectrogram includes:
99+
100+
- Vertical axis: Frequency scale (kHz)
101+
- Horizontal axis: Time scale (min:sec)
102+
- Right side: dB scale (-120dB to 0dB)
103+
- Color mapping: Using Turbo colormap, red indicates high intensity, blue indicates low intensity
104+
105+
## License
106+
107+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

README.zh-CN.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# AudioSpectrogram
2+
3+
AudioSpectrogram 是一个功能强大的音频频谱图生成工具,支持多种音频格式,可生成高质量的频谱图。使用 Rust 语言开发,提供跨平台支持,可在 Windows、macOS 和 Linux 系统上运行。
4+
5+
## 功能特点
6+
7+
- 跨平台支持(Windows、macOS、Linux)
8+
- Windows 平台支持文件拖拽操作
9+
- 支持多种音频格式:WAV、MP3、FLAC、OGG、AAC 等
10+
- 使用 Turbo 色彩映射生成高质量频谱图
11+
- 自动处理多声道音频(混合为单声道)
12+
- 精确的时间和频率刻度
13+
- 完整的 dB 刻度显示(-120dB 到 0dB)
14+
- 可自定义 FFT 大小和 hop size
15+
16+
## 示例频谱图
17+
18+
![示例频谱图](resources/sample-spectrogram.jpg)
19+
20+
这是使用本工具生成的频谱图示例,展示了 OneRepublic 的 "Apologize"(44.1kHz 采样率)。频谱图清晰地展示了:
21+
22+
- 完整的频率范围(0-22.05kHz)
23+
- 清晰的时间轴标记
24+
- 精确的频率刻度
25+
- 丰富的动态范围显示(-120dB 到 0dB)
26+
27+
## 系统要求
28+
29+
- Rust 工具链(推荐通过 [rustup](https://rustup.rs/) 安装)
30+
- Cargo(Rust 包管理器,随 Rust 一起安装)
31+
- 系统需要安装至少一种等宽字体:
32+
- Windows:Consolas
33+
- macOS:Monaco
34+
- Linux:DejaVu Sans Mono
35+
36+
## 编译步骤
37+
38+
1. 克隆仓库:
39+
40+
```bash
41+
git clone https://github.com/lmshao/AudioSpectrogram.git
42+
cd AudioSpectrogram
43+
```
44+
45+
2. 编译项目:
46+
47+
```bash
48+
cargo build --release
49+
```
50+
51+
编译后的可执行文件将位于 `target/release` 目录下。
52+
53+
## 使用方法
54+
55+
基本用法:
56+
57+
```bash
58+
AudioSpectrogram -i input.mp3
59+
```
60+
61+
在 Windows 系统上,你可以直接将音频文件拖拽到程序图标上,程序会自动生成频谱图。这是最简单的使用方式。
62+
63+
或者在命令行中直接指定文件:
64+
65+
```bash
66+
AudioSpectrogram input.mp3
67+
```
68+
69+
### 命令行参数
70+
71+
- `-i, --input <FILE>`:输入音频文件路径
72+
- `-o, --output <FILE>`:输出图片路径(可选,默认为与输入文件同名的 PNG 文件)
73+
- `-f, --fft-size <SIZE>`:FFT 大小(可选,默认为 4096)
74+
- `-p, --hop-size <SIZE>`:Hop 大小(可选,默认为 FFT 大小的一半)
75+
76+
### 使用示例
77+
78+
1. 使用默认参数生成频谱图:
79+
80+
```bash
81+
AudioSpectrogram -i music.flac
82+
```
83+
84+
2. 指定输出文件名:
85+
86+
```bash
87+
AudioSpectrogram -i music.flac -o spectrum.png
88+
```
89+
90+
3. 自定义 FFT 参数:
91+
92+
```bash
93+
AudioSpectrogram -i music.flac -f 8192 -p 2048
94+
```
95+
96+
### 输出说明
97+
98+
生成的频谱图包含以下信息:
99+
100+
- 垂直轴:频率刻度(kHz)
101+
- 水平轴:时间刻度(分:秒)
102+
- 右侧:dB 刻度(-120dB 到 0dB)
103+
- 颜色映射:使用 Turbo 色彩方案,红色表示强度高,蓝色表示强度低
104+
105+
## 许可证
106+
107+
本项目采用 MIT 许可证。详见 [LICENSE](LICENSE) 文件。

resources.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ BEGIN
1919
VALUE "FileDescription", "Audio Spectrogram Generator - A tool for generating high-quality spectrograms from audio files"
2020
VALUE "FileVersion", "0.1.1.0"
2121
VALUE "InternalName", "AudioSpectrogram"
22-
VALUE "LegalCopyright", "Copyright (C) 2024 SHAO Liming. All rights reserved."
22+
VALUE "LegalCopyright", "Copyright (C) 2025 SHAO Liming. All rights reserved."
2323
VALUE "OriginalFilename", "AudioSpectrogram.exe"
2424
VALUE "ProductName", "Audio Spectrogram Generator"
25-
VALUE "ProductVersion", "0.1.1.0"
25+
VALUE "ProductVersion", "0.1.1"
2626
VALUE "Comments", "Supports WAV, MP3, FLAC, OGG, AAC and other audio formats"
2727
VALUE "Website", "https://github.com/lmshao/AudioSpectrogram"
2828
END

resources/sample-spectrogram.jpg

389 KB
Loading

0 commit comments

Comments
 (0)