Closed darshil-evolution closed 3 weeks ago
I am having the same problem:
AudioFileObject.cpp:53 CreateDataFile failed
Figured it out, if you want specific file in IOS: you need to append file://
So the path would be:
const path = `file://${RNFS.DocumentDirectoryPath}/${name}`;
From code:
func setAudioFileURL(path: String) {
if (path == "DEFAULT") {
let cachesDirectory = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first!
audioFileURL = cachesDirectory.appendingPathComponent("sound.m4a")
} else if (path.hasPrefix("http://") || path.hasPrefix("https://") || path.hasPrefix("file://")) {
audioFileURL = URL(string: path)
} else {
let cachesDirectory = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first!
audioFileURL = cachesDirectory.appendingPathComponent(path)
}
}
Will put out a diff to update Readme.
Not able to recored the audio in iOS. Getting errors in xcode consloe
CreateDataFile failed
andCouldn't create a new audio file object
. In android working perfect. When I am giving just name in path likeaudioFile.acc
it's working fine but when using RNFS path that time getting error.Expected behavior: I want to store audio on RNFS.DocumentDirectoryPath Actual behavior: Error starting recording: [Error: Error occured during initiating recorder]