1
테스트 할 때 ForgeLog
및 NSLog
이 내 Safari 웹 검사기에 표시되지 않습니다. 잘못되었거나 의도적입니까?웹 검사기에 로그가 나타나지 않습니다.
[ForgeLog d:@"Playing file at..."];
편집 : 나머지 코드는 다음과 같습니다. (이번에는 NSLog
를 사용.)
#import "audio_API.h"
static AVAudioPlayer* player = nil;
@implementation audio_API
+ (void)play:(ForgeTask*)task {
// parse the file url from the file object
ForgeFile* file = [[ForgeFile alloc] initWithFile:[task.params objectForKey:@"file"]];
NSString* fileURL = [file url];
NSLog(@"Playing file at %@", fileURL);
NSURL* url = [[NSBundle mainBundle] URLForResource:fileURL withExtension:@"m4a"];
// TESTING
//url = [[NSBundle mainBundle] URLForResource:@"seconds" withExtension:@"m4a"];
// END TESTING
NSAssert(url, @"URL is invalid.");
// create the player
NSError* error = nil;
player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
if(!player)
{
NSLog(@"Error creating player: %@", error);
};
[player play];
[task success:nil];
}
전화하는 방법을 게시 할 수 있습니까? –
@ChrisLoonam 귀하의 요청에 따라 내 게시물을 편집했습니다 :) – Garrett