复制音频直接在iPhone上的音频缓冲 [英] Copy Audio directly to audio buffer on iPhone

查看:120
本文介绍了复制音频直接在iPhone上的音频缓冲的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法,以复制到AudioQueueBuffer直接?

我期待重新创建一个Android应用程序所使用android.AudioTrack的write()函数直接写入到一个声音缓冲区。我所能做的使用AudioQueueBuffer类似的事情在iPhone上?

我要做的线沿线的东西:

  AudioQueueAllocateBuffer(mAudioQueueData.mQueue,数据大小,和放大器; mAudioQueueData.mBuffer);
mAudioQueueData.mBuffer-> mAudioDataByteSize =数据大小;
的memcpy(mAudioQueueData.mBuffer-> mAudioData,soundData,数据大小);
AudioQueueStart(mAudioQueueData.mQueue,NULL);


解决方案

是的,它是可能的,你找什么叫RemoteIO。这是有点难以成立第一个,但给你的音频缓冲区的直接控制,是iPhone上的最低级别的音频API。

看看这个教程开始: http://atastypixel.com/blog /使用-remoteio音频单元/

也有这些有用的系列博客文章:的http:/ /timbolstad.com/2010/03/14/core-audio-getting-started/

Is there a way to copy to an AudioQueueBuffer directly?

I am looking to re-create an Android app that used android.AudioTrack's write() function to write directly to a sound buffer. Can I do a similar thing using the AudioQueueBuffer on the iPhone?

I was going to do something along the lines of:

AudioQueueAllocateBuffer( mAudioQueueData.mQueue, dataSize, &mAudioQueueData.mBuffer);
mAudioQueueData.mBuffer->mAudioDataByteSize = dataSize;
memcpy(mAudioQueueData.mBuffer->mAudioData, soundData, dataSize);
AudioQueueStart(mAudioQueueData.mQueue, NULL);

解决方案

Yes it's possible, what your looking for is called RemoteIO. It's kinda hard to set up first, but gives you direct control of the audio buffer and is the lowest-level audio API on the iPhone.

Check out this tutorial to get started: http://atastypixel.com/blog/using-remoteio-audio-unit/

There are also these useful series of blog posts: http://timbolstad.com/2010/03/14/core-audio-getting-started/

这篇关于复制音频直接在iPhone上的音频缓冲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆