问题描述
有没有一种方法,以复制到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。
看看这个教程开始:
也有这些有用的系列博客文章:
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上的音频缓冲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!