AVAudioPlayer在扬声器和耳机上声音太低

时间:2016-02-17 03:10:40

标签: objective-c xcode7 avaudioplayer ios8.3

我有以下代码可以播放声音缓冲区,但无论我尝试什么,即使系统音量已达到最高水平,扬声器和耳机的音量仍然太低。我的代码有什么问题?

-(void)playSound:(NSData *)data {
    NSError* error;
    player = [[AVAudioPlayer alloc] initWithData:data error:&error];

    if (error) {
        // TODO: log error
    }
    [player setNumberOfLoops:0];
    [player setVolume:1.0f];
    player.delegate = (id)self;
    [soundArray insertObject:player atIndex:0];
    [player prepareToPlay];
    [player play];
}

0 个答案:

没有答案