Sicher kannst du, aber sprechen Ich bin zuversichtlich, dass dies eine Aufgabe für einen Kunden von mir ist, und er hat keine externen Funktionen oder Brücken oder was auch immer mit der Foundation in den Kernklassen angefordert. Also musste ich eine Audioqueue-Komponente ohne Bezug auf Foundation erstellen.
Für das Protokoll, ich succedeed dies nur tun:
const char *home = getenv("HOME");
const char *subdir = "/Documents/";
const char *file = "recordedFile.caf";
char *recPath = (char*)(calloc(strlen(home) + strlen(subdir)
+ strlen(file) + 1, sizeof(char)));
strcpy(recPath, home); // copy string one into the result.
strcat(recPath, subdir); // append string two to the result.
strcat(recPath, file); // append string three to the result.
//recordFilePath is our CFStringRef
recordFilePath = CFStringCreateWithCString(0, recPath, kCFStringEncodingUTF8);
//recorder is an AQRecorder class like the one from SpeakHere code sample
recorder->StartRecord(recordFilePath);
Können Sie erklären, warum Sie nicht die Foundation-API verwenden können, wenn seine auf einem iPhone laufen soll? – abidon
Weil es mit Cocos2d-x kompilieren muss. – CttPla
Ich denke, das ist, was ich gesucht habe, wenn noch gültig: http://StackOverflow.com/Questions/13469342/using-c-to-access-documents-folder-on-ios – CttPla