我正在使用avplayer播放音频网址,但它无法正常工作,我不知道我错在哪里
NSString *radioURL = @"https://www.example.com";
radioPlayer = [AVPlayer playerWithURL:[NSURL URLWithString:radioURL]] ;
// [radioPlayer seekToTime:kCMTimeZero];
NSLog(@"radio player %@",radioPlayer.currentItem);
[radioPlayer play];
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激.
我想录制一个音频文件并以.wav格式上传到服务器,但录制器不允许我将文件录制成wav格式.
用于记录我已经使用过代码:NSMutableDictionary*recordSetting = [[NSMutableDictionary alloc] init];
[recordSetting setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
[recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];
// Initiate and prepare the recorder
recorder = [[AVAudioRecorder alloc] initWithURL:outputFileURL settings:recordSetting error:nil];
recorder.delegate = self;
recorder.meteringEnabled = YES;
[recorder prepareToRecord];
Run Code Online (Sandbox Code Playgroud)
我找到的另一种方法,录音后将文件从caff转换为wav,但这对我来说也不起作用.
我已经使用从caff到wav的转换文件的代码:
-(BOOL)exportAssetAsWaveFormat:(NSURL*)filePath
{
NSError *error = nil ;
NSDictionary *audioSetting = [NSDictionary dictionaryWithObjectsAndKeys:
[ NSNumber numberWithFloat:44100.0], AVSampleRateKey,
[ NSNumber numberWithInt:2], AVNumberOfChannelsKey,
[ NSNumber numberWithInt:16], AVLinearPCMBitDepthKey,
[ NSNumber numberWithInt:kAudioFormatLinearPCM], AVFormatIDKey,
[ NSNumber numberWithBool:NO], AVLinearPCMIsFloatKey,
[ NSNumber numberWithBool:0], AVLinearPCMIsBigEndianKey,
[ NSNumber …Run Code Online (Sandbox Code Playgroud) 归档时(发布时)我收到错误
ld: entry point (_main) undefined. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: entry point (_main) undefined. for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激.