Coreaudio : Extaudiofilecreatewithurl이 0xffffffce를 반환하는 이유는 무엇입니까?

StackOverflow https://stackoverflow.com/questions/531066

  •  22-08-2019
  •  | 
  •  

문제

반환하기위한 것입니다 OSType, 그러나 대신 나는 단지 -50을 받고 있습니다. 이것이 어떤 오류를 나타내는 지 아는 사람이 있습니까? 어디서나 찾을 수 없습니다.

컨텍스트를위한 코드 스 니펫 (오류가 너무 모호합니다. 나는 어떤 스 니펫을 붙여 넣을지 모르겠습니다. 여기에 거의 모든 것이 있습니다) :

ExtAudioFileRef cafFile;
AudioStreamBasicDescription cafDesc;

cafDesc.mBitsPerChannel = 16;
cafDesc.mBytesPerFrame = 4;
cafDesc.mBytesPerPacket = 4;
cafDesc.mChannelsPerFrame = 2;
cafDesc.mFormatFlags = 0;
cafDesc.mFormatID = 'ima4';
cafDesc.mFramesPerPacket = 1;
cafDesc.mReserved = 0;
cafDesc.mSampleRate = 44100;

OSType status = ExtAudioFileCreateWithURL(
                   fileURL,                    // inURL
                   'caff',                     // inFileType
                   &cafDesc,                   // inStreamDesc
                   NULL,                       // inChannelLayout
                   kAudioFileFlags_EraseFile,  // inFlags
                   &cafFile                    // outExtAudioFile
                   );    // returns 0xFFFFFFCE
도움이 되었습니까?

해결책

ExtAudioFileCreateWithURL() 반환합니다 OSStatus, OSType. 파일을 참조하십시오 MacErrors.h 다양한 오류 코드의 경우. 이 경우 -50은입니다 paramErr (사용자 매개 변수 목록의 오류) 따라서 하나 이상의 매개 변수를 함수에 잘못 전달합니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top