AudioStreamer
AudioStreamer copied to clipboard
Deprecated ''withUnsafeMutableBytes' and 'withUnsafeBytes'
Hi, Thank you for creating this framework, it has been exactly what I needed for my project. Since the shift to swift 5 there are two warnings due to deprecation:
''withUnsafeMutableBytes' is deprecated: use
withUnsafeMutableBytes<R>(_: (UnsafeMutableRawBufferPointer) throws -> R) rethrows -> Rinstead
'withUnsafeBytes' is deprecated: use
withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> Rinstead
I have not focused on fixing this yet but I thought of mentioning it already.
For those who are looking for the fix.
_ = data.withUnsafeBytes { pointer in
guard let bytes = pointer.baseAddress?.assumingMemoryBound(to: Unit8.self) else { return }
//... use bytes here
}