2012-08-27 5 views

답변

3

CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer로 작업 한 지 몇 달 만에, 나는 그 기능에 대해 특별히 게시물이나 링크를 찾기가 어렵지만, iOS의 오디오 주제에 대한 많은 정보를 쉽게 찾을 수 있음을 알게되었습니다. 그들 사이에 책이 있습니다 Learning Core Audio ..

iOS 코어 오디오의 밀집된 개념이 가라 앉는 데는 많은 시간이 걸리며, 많은 연습이 필요합니다. 위의 방법은 다음과 같은 쉬운 도구가 될 것입니다. 훨씬 더 큰 도구 상자 .. 그리고 모든 매개 변수와 사용법은 직관적 인 의미를 갖습니다.

또한 매개 변수에 대해 알아 보는 빠른 방법과 함수는 단순히 위의 작업을 수행합니다. 단순히 헤더 파일에 제공된 문서로 이동하십시오 (즉, XCode에서 메소드를 강조 표시하고 마우스 오른쪽 버튼으로 클릭> 정의로 이동). CMSampleBuffer.h에이 내용이 표시됩니다 당신은 핵심 오디오에 익숙하지 않습니다.이 모든 매개 변수를보고 10 % 만 이해하면 좌절하지 마십시오. 우리 모두에게 일어 났으며 시간이 필요합니다.

/*! 
    @function CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer 
    @abstract Creates an AudioBufferList containing the data from the CMSampleBuffer, 
       and a CMBlockBuffer which references (and manages the lifetime of) the 
       data in that AudioBufferList. The data may or may not be copied, 
       depending on the contiguity and 16-byte alignment of the CMSampleBuffer's 
       data. The buffers placed in the AudioBufferList are guaranteed to be contiguous. 
       The buffers in the AudioBufferList will be 16-byte-aligned if 
       kCMSampleBufferFlag_AudioBufferList_Assure16ByteAlignment is passed in. 
*/ 
CM_EXPORT 
OSStatus CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(
    CMSampleBufferRef sbuf,    /*! @param sbuf 
             CMSampleBuffer being accessed. */ 
    size_t *bufferListSizeNeededOut, /*! @param bufferListSizeNeededOut 
             Receives the size of the AudioBufferList required to 
             accommodate the data. May be NULL. */ 
    AudioBufferList *bufferListOut,  /*! @param bufferListOut 
             Allocated by the caller, sized as specified by bufferListSizeNeededOut. 
             It is filled in with pointers into the retained blockBufferOut. 
             May be NULL. */ 
    size_t bufferListSize,    /*! @param bufferListSize 
             Size of the bufferListOut allocated by the client. If bufferListOut 
             is not NULL and bufferListSize is insufficient, kFigSampleBufferError_ArrayTooSmall 
             is returned. */ 
    CFAllocatorRef bbufStructAllocator, /*! @param bbufStructAllocator 
             Allocator to use when creating the CMBlockBuffer structure. */ 
    CFAllocatorRef bbufMemoryAllocator, /*! @param bbufMemoryAllocator 
             Allocator to use for memory block held by the CMBlockBuffer. */ 
    uint32_t flags,      /*! @param flags 
             Flags controlling operation. */ 
    CMBlockBufferRef *blockBufferOut) /*! @param blockBufferOut 
             The retained CMBlockBuffer. */ 
          __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); 
+0

마지막 매개 변수를 이해하지 못합니다. 그것은 "_The_는 CMBlockBuffer를 유지했습니다."라고 말합니다. 그건 확실한 기사의 사용입니다! 'CMBlockBuffer'는 무엇입니까? 'CMSampleBufferGetDataBuffer'에 의해 리턴 된 것? –