测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
Released最新版本 | 2014年12月 |
由 Matthias Plappert 维护。
MPSoundEngine
允许您在 OS X 上非常容易地合成单声道或立体声输出。
MPSoundEngine
设计得尽可能容易使用。有两个具体的子类,MPMonoSoundEngine
和 MPStereoSoundEngine
。您通过 MPSoundChannel
对象与之交互。
此项目还包括一个示例。要运行示例项目;克隆仓库,并首先从 Example 目录运行 pod install
。
以下是如何合成 A 音乐音符作为单声道信号的方法。
MPMonoSoundEngine *engine = [[MPMonoSoundEngine alloc] init];
engine.channel.frequency = 440.0; // 440 Hz is the musical note A
[engine start];
以下是如何在左侧通道合成 A 音乐音符,在右侧通道合成 C 音乐音符作为立体声信号的方法。
MPStereoSoundEngine *engine = [[MPStereoSoundEngine alloc] init];
engine.leftChannel.frequency = 440.0; // 440 Hz is the musical note A
engine.rightChannel.frequency = 261.00; // 261 Hz is the musical note C
[engine start];
Matthias Plappert, [email protected]
此代码部分基于 Alex Chaffee 在 stackoverflow 上提供的示例。
MPSoundEngine 适用于 MIT 许可证。查看 LICENSE 文件获取更多信息。