Closed JqyModi closed 4 years ago
@JqyModi, hello, could you provide code example or additional info?
DemoURL:https://github.com/JqyModi/Swift_Sox
I plan to use sox to process audio files, but I don't know how to convert the objects obtained by Swift into the array pointer received by C, the code is located in the SRC folder, I have the place of the comment, comment: // how to convert sourceRead to UnsafePointer<unsafemutablepointer
@pro100andrey
@JqyModi
Like this:
let argv = UnsafePointer(sourceRead.withMemoryRebound(to: Int8.self, capacity: MemoryLayout<sox_format_t>.size) { $0 })
How do I turn Swift or OC objects into C arrays (char * argv[]), for example UnsafePointer to UnsafePointer<UnsafeMutablePointer?>?