GregM
GregM

Reputation: 3734

Error when playing AudioFile with Agora in Unity3d on iOS

audio file plays on windows, but will not play on iOS. Tried .wav and .mp3 as well as a URL to a .mp3 file

2020-08-06 16:40:18.336561-0500 Dev[6676:1857168] ExtAudioFile.cpp:192:Open: about to throw 'wht?': open audio file
2020-08-06 16:40:18.336920-0500 Dev[6676:1857168] [avae]            AVAEInternal.h:109   [AVAudioFile.mm:134:AVAudioFileImpl: (ExtAudioFileOpenURL((CFURLRef)fileURL, &_extAudioFile)): error 2003334207
2020-08-06 16:40:18.337266-0500 Dev[6676:1857168] ExtAudioFile.cpp:192:Open: about to throw 'wht?': open audio file
2020-08-06 16:40:18.337668-0500 Dev[6676:1857168] [avae]            AVAEInternal.h:109   [AVAudioFile.mm:134:AVAudioFileImpl: (ExtAudioFileOpenURL((CFURLRef)fileURL, &_extAudioFile)): error 2003334207

Upvotes: 0

Views: 231

Answers (1)

Rick Cheng
Rick Cheng

Reputation: 654

I was able to reproduce this problem. It is because the file path you provide. In Unity, you should place your audio file in StreamingAssets folder, and pass the file path Application.streamingAssetsPath + "/filename" to the PlayEffect call.

Upvotes: 1

Related Questions