diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..37f24a6fc1a158070af4484f26a7b7c6d0aff51c --- /dev/null +++ b/README.en.md @@ -0,0 +1,54 @@ +# Opus Audio Codec Example + +This is a simple example project that demonstrates audio encoding and decoding using the Opus library. The project includes two programs: one for recording audio and encoding it into Opus format, and another for decoding and playing Opus audio. + +## Features + +- Uses the Opus library for audio encoding and decoding +- Uses the ALSA library for audio device operations +- Includes two separate programs: recording and playback + +## Build Requirements + +- CMake 3.10.0 or higher +- Opus development libraries +- ALSA development libraries + +## Build Instructions + +```bash +mkdir build +cd build +cmake .. +make +``` + +This will build two executable files: `record` and `play`. + +## Usage + +### Record Audio + +```bash +./record +``` + +This records audio from the default audio input device, encodes it into Opus format, and saves it as a file named "record.opus". + +### Play Audio + +```bash +./play +``` + +This plays the previously recorded "record.opus" file. + +## Code Structure + +- `record.c` - Recording program containing audio recording and Opus encoding logic +- `play.c` - Playback program containing Opus decoding and audio playback logic +- `CMakeLists.txt` - CMake build configuration file + +## License + +Please refer to the LICENSE file in the project for licensing information. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..de08c314c48a0f843badd4f188962bb2090a056c --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# Opus 音频编解码示例 + +这是一个使用 Opus 库进行音频编解码的简单示例项目。该项目包含两个程序:一个用于录制音频并将其编码为 Opus 格式,另一个用于解码并播放 Opus 音频。 + +## 特性 + +- 使用 Opus 库进行音频编码和解码 +- 使用 ALSA 库进行音频设备操作 +- 包含录制和播放两个独立程序 + +## 构建要求 + +- CMake 3.10.0 或更高版本 +- Opus 开发库 +- ALSA 开发库 + +## 构建方法 + +```bash +mkdir build +cd build +cmake .. +make +``` + +这将构建两个可执行文件:`record` 和 `play`。 + +## 使用方法 + +### 录制音频 + +```bash +./record +``` + +这将从默认音频输入设备录制音频,并将其编码为 Opus 格式,保存为 "record.opus" 文件。 + +### 播放音频 + +```bash +./play +``` + +这将播放之前录制的 "record.opus" 文件。 + +## 代码结构 + +- `record.c` - 录制程序,包含音频录制和 Opus 编码逻辑 +- `play.c` - 播放程序,包含 Opus 解码和音频播放逻辑 +- `CMakeLists.txt` - CMake 构建配置文件 + +## 许可证 + +请查看项目中的 LICENSE 文件以了解许可证信息。 \ No newline at end of file