是否可以增加系统声音的音量?

时间:2012-11-01 08:25:10

标签: iphone ios audiotoolbox

我正在为iPad制作钢琴应用程序。我使用AudioServicesPlaySystemSound(toneSSID)来播放键的声音。但也有增加音量的功能。但我没有找到如何增加声音。有人能帮助我吗?

感谢。

1 个答案:

答案 0 :(得分:1)

添加AudioStreamer.h文件

将此方法添加到AudioStreamer.m

- (void)setVolume:(float)Level
{

OSStatus errorMsg = AudioQueueSetParameter(audioQueue, kAudioQueueParam_Volume, Level);

if (errorMsg) {
    NSLog(@"AudioQueueSetParameter returned %d when setting the volume.", errorMsg);
}

}

并将此处理为audiostreamclass对象,如

AudioStreamer * Obj = [AudioStreamer alloc] init];

[obj setVolume:1.0];