【问题标题】:How to record Piano?如何录制钢琴?
【发布时间】:2013-08-22 02:10:32
【问题描述】:

我有一个基于触控的钢琴应用程序,现在我想在其中添加一个录音功能。谁能指导我这样做。但我需要记录下来并发送到流中。

-(void) viewDidLoad {
    [super viewDidLoad];
    [keyboardView setVisibleKeyRange: NSMakeRange(48, 5)];

    if (audio == nil) {
        [self setAudio:[NSMutableArray arrayWithCapacity:0]];
    }

    [drawingView setShowOutsideLedger:YES];

    NSString* plistPath = [[NSBundle mainBundle] pathForResource:@"keyboardLayout" ofType:@"plist"];
    NSArray* names = [NSArray arrayWithContentsOfFile:plistPath];

    // Load Audio
    for (int i = 0; i < [names count]; i++) {
        SystemSoundID soundID;
        AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:names[i] ofType:@"aif"]], &soundID);  
        NSNumber* audioId = @(soundID);
        [audio addObject:audioId];
    }

    [[self keyboardView] setDelegate:self];
    [[self octaveSelectionView] setDelegate:self];

     }

- (void) keysPressed:(NSSet *)keys {
    NSLog(@"keysPressed=%d", [keys count]);

    [drawingView addNotes:keys];

    for (NSNumber* keyIndex in keys) {
        if ([audio count] > [keyIndex intValue]) {
            SystemSoundID soundID = [audio[[keyIndex intValue]] unsignedLongValue];
            AudioServicesPlaySystemSound(soundID);
        }
    } }

【问题讨论】:

    标签: ios streaming audio-streaming icecast piano


    【解决方案1】:

    只是想知道如何保存关键命中笔记并记录本地数据库上的延迟计时器。之后使用 AVAsset 组合命中音频和静音音频以保存或重放。有帮助吗

    【讨论】:

    • 在这种情况下,我将无法录制多个播放。如果用户同时播放两种音调,则只会录制其中一种音调。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-12
    • 1970-01-01
    • 1970-01-01
    • 2015-06-01
    相关资源
    最近更新 更多