【问题标题】:How to record audio from playing music player如何从播放音乐播放器录制音频
【发布时间】:2010-09-21 03:28:16
【问题描述】:

在我的应用程序中,我使用 AvAudioplayer 播放音频,播放音频后,我必须记录来自 AvAudioplayer 的音频和任何其他外部噪音以及音频。

我该怎么做。

谢谢

【问题讨论】:

    标签: iphone avaudiorecorder


    【解决方案1】:

    使用此功能播放声音

    - (AVAudioPlayer *)getNoteFromFilename:(NSString *)name andoftype:(NSString *)type{
    NSString *soundPath = [[NSBundle mainBundle] pathForResource:name
                                                          ofType:type];
    NSURL *fileURL = [NSURL fileURLWithPath:soundPath];
    AVAudioPlayer *note = [[[AVAudioPlayer alloc] initWithContentsOfURL:fileURL
                                                                  error:nil] autorelease];
    return note;
    

    你可以像这样调用函数

    self.btn_do = [self getNoteFromFilename:@"MusicFileName" andoftype:@"mp3"];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-03
      • 1970-01-01
      • 1970-01-01
      • 2012-06-19
      • 1970-01-01
      相关资源
      最近更新 更多