当我尝试设置音频配置编写器输入时,出现错误:
-[__NSCFNumber length]: unrecognized selector sent to instance 0xbcdab0
我的代码:
NSObject[] values = new NSObject[]
{
NSNumber.FromFloat(44100.0f),
NSNumber.FromInt32((int)MonoTouch.AudioToolbox.AudioFormatType.MPEG4AAC),
NSNumber.FromInt32(2),
NSNumber.FromInt32((int)AVAudioQuality.Medium)
};
//Set up the NSObject Array of keys that will be combined with the values to make the NSDictionary
NSObject[] keys = new NSObject[]
{
AVAudioSettings.AVSampleRateKey,
AVAudioSettings.AVFormatIDKey,
AVAudioSettings.AVNumberOfChannelsKey,
AVAudioSettings.AVChannelLayoutKey
};
//Set Settings with the Values and Keys to create the NSDictionary
NSDictionary audiosettings = NSDictionary.FromObjectsAndKeys (values, keys);
writeraudioInput = new AVAssetWriterInput (AVMediaType.Audio, audiosettings);