iOS PCM硬编成AAC

  • D3_560893
    了解作者
  • 4MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-19 22:38
    上传日期
非常直观的把pcm通过audiotoolbox提供的接口,硬编成aac,工程内包含一个pcm文件,只要点击转换,就可以生成相应的aac文件(可以通过iTunes把aac文件取出),相对直观的可以了解audiotoolbox的工作流程。
testIOSHWEncode.zip
内容介绍
// // cRecorder.h // audioRecorder // // Created by maliy on 8/24/10. // Copyright 2010 interMobile. All rights reserved. // #import <UIKit/UIKit.h> #import <audioToolbox/AudioToolbox.h rel='nofollow' onclick='return false;'> #define AUDIO_BUFFERS 5 #define kBufferDurationSeconds .5 @class cRecorder; typedef struct AQCallbackStruct { AudioStreamBasicDescription mDataFormat; AudioQueueRef queue ; AudioQueueBufferRef mBuffers[AUDIO_BUFFERS]; AudioFileID outputFile; UInt32 frameSize; long long recPtr; int run; AudioQueueLevelMeterState *_chan_lvls; __unsafe_unretained cRecorder *recorder; } AQCallbackStruct; @protocol cRecorderDelegate @optional - (void) recorder:(cRecorder *) recorder levels:(NSArray *) lvls; - (void)gotAacData:(NSData*)data timeStamp:(int)timeStamp; @end @interface cRecorder : NSObject { AQCallbackStruct aqc; // BOOL recording; // id<cRecorderDelegate> delegate; // @public unsigned int mSampleRate; // @public unsigned int mChannelsPerFrame; } @property (nonatomic, readonly) NSString *fileName; @property (nonatomic, assign) int mSampleRate; @property (nonatomic, assign) int mChannelsPerFrame; @property (nonatomic, assign) BOOL recording; @property (nonatomic, assign) id<cRecorderDelegate> delegate; - (BOOL) init_recoder; - (BOOL) start; - (void) stop; @end
评论
    相关推荐