0
我試圖在磁盤上創建一個新文件並使用OSX上的Core Audio框架對其進行記錄。我現在的主要障礙是我無法使用下面的代碼創建文件。我的目標是找出爲什麼下面的代碼不工作,以便我可以繼續在我的項目的其餘部分工作。你可以在下面看到這個代碼的輸出。無法使用AudioFileCreateWithURL()創建音頻文件
string fp = "…path…to…file.../file.wav"
CFURLRef audioFileURL = CFURLCreateFromFileSystemRepresentation(
NULL,
(const UInt8 *)fp.c_str(), // filename
fp.length(), // number of bytes in filename
false // this is a file, not a directory
);
if(audioFileURL == NULL){
cout << endl << "audioFileURL == NULL :(";
}
OSStatus retErr = AudioFileCreateWithURL (
audioFileURL,
df.mFormatID,
&aqData.mDataFormat,
kAudioFileFlags_EraseFile,
&aqData.mAudioFile
);
cout << endl << "\nAudioFileCreateWithURL error:" << retErr;
其輸出以下:
AudioFileCreateWithURL error:1954115647
我沒有任何運氣找出這個錯誤是什麼意思。任何幫助這裏apprecaited。