【问题标题】:How to play audio buffer which from remote side for iOS?如何从 iOS 的远程端播放音频缓冲区?
【发布时间】:2012-11-18 09:35:05
【问题描述】:

我发布了一个关于从 Recorder 获取 AudioBuffer 的问题,

我的相关问题: Is there any high level Audio Queue Record Service Library for iOS?

我可以从记录器中获取缓冲区并将其放入 NSData,然后通过 udp 套接字发送。

但是如何在另一台 iOS 设备上使用缓冲区?

有没有办法播放缓冲区?

我研究了一些示例代码,但其中大多数只是在录音机录制时播放。

有没有更详细的教程可以从远程播放缓冲区?

更新:我现在刚刚解决了

关键函数是播放回调函数!

static OSStatus playbackCallback(void *inRefCon, 
                                  AudioUnitRenderActionFlags *ioActionFlags, 
                                  const AudioTimeStamp *inTimeStamp, 
                                  UInt32 inBusNumber, 
                                  UInt32 inNumberFrames, 
                                  AudioBufferList *ioData) {    
    // Notes: ioData contains buffers (may be more than one!)
    // Fill them up as much as you can. Remember to set the size value in each buffer to match how
    // much data is in the buffer.
    return noErr;
}

顺便说一句,应该经常检查你使用的低级东西!

例如:ma​​lloc memcpy 免费

【问题讨论】:

    标签: objective-c ios audio voip audioqueue


    【解决方案1】:

    如果我理解你的问题,那么我认为这个链接可以帮助你:https://github.com/mattgallagher/AudioStreamer

    AudioStreamer 用于在流式传输时播放远程音频。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-31
      • 2023-03-06
      • 2017-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-22
      相关资源
      最近更新 更多