Posts

Post not yet marked as solved
4 Replies
3.5k Views
According to the ATO site, if I am a sole trader with revenue of < $75k per annum, I am not requried to register for GST.However, Apple insists I register for GST in order to sell apps on the store in Australia.What do I put on my BAS statement? If I have < $75k revenue, do I say "I had $x revenue and I owe GST of $0"? Or do I say, "I had $x revenue and I owe GST of $x/11" and then just don't pay it?(I know You Are Not A Tax Lawyer, but Australians registered for GST but with revenue below the $75k threshold, what do you do?)
Posted
by ratkins.
Last updated
.
Post marked as solved
3 Replies
2.0k Views
I have an array of Float (representing audio samples) and I want to turn it into an AVAudioPCMBuffer so I can pass it to AVAudioFile's write(from:). There's an obvious way (actually not obvious at all, I cribbed it from this gist): var floats: [Float] = ... // this comes from somewhere else let audioBuffer = AudioBuffer(mNumberChannels: 1, mDataByteSize: UInt32(floats.count * MemoryLayout<Float>.size), mData: &floats) var bufferList = AudioBufferList(mNumberBuffers: 1, mBuffers: audioBuffer) let outputAudioBuffer = AVAudioPCMBuffer(pcmFormat: buffer.format, bufferListNoCopy: &bufferList)! try self.renderedAudioFile?.write(from: outputAudioBuffer) This works (I get the audio output I expect) but in Xcode 13.4.1 this gives me a warning on the &floats: Cannot use inout expression here; argument 'mData' must be a pointer that outlives the call to 'init(mNumberChannels:mDataByteSize:mData:)' Ok, scope the pointer then: var floats: [Float] = ... // this comes from somewhere else try withUnsafeMutablePointer(to: &floats) { bytes in let audioBuffer = AudioBuffer(mNumberChannels: 1, mDataByteSize: UInt32(bytes.pointee.count * MemoryLayout<Float>.size), mData: bytes) var bufferList = AudioBufferList(mNumberBuffers: 1, mBuffers: audioBuffer) let outputAudioBuffer = AVAudioPCMBuffer(pcmFormat: buffer.format, bufferListNoCopy: &bufferList)! try self.renderedAudioFile?.write(from: outputAudioBuffer) } The warning goes away, but now the output is garbage. I really don't understand this as floats.count and bytes.pointee.count are the same number. What am I doing wrong?
Posted
by ratkins.
Last updated
.
Post not yet marked as solved
3 Replies
1.3k Views
SwiftUI Previews in Xcode 13.2.1 (13C100) are failing for me with: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/usr/lib/swift/shims/Visibility.h' has been modified since the module file '/var/folders/s_/v2rt7nls5794blqbt6c_gl9c0000gn/C/clang/ModuleCache/2LAIGLYLJJQNA/SwiftShims-2TTN5UXQBRCCQ.pcm' was built: mtime changed This is after quitting Xcode, deleting derived data, starting Xcode again and building from scratch. Anyone else seeing this problem? Any idea how to fix it?
Posted
by ratkins.
Last updated
.
Post marked as solved
1 Replies
717 Views
After posting this question on Stack Overflow the other day, I've done some investigations with small numbers of nodes and my conclusion holds up. Calling .flattenedClone() on the node containing all my geometries and adding the result to the root node increases my draw call count!What on earth is going on? Is .flattenedClone() somehow broken on iOS 12 or am I missing something?This is representative of the code I'm testing with: let boardNode = SCNNode() (0...widthCellCount).forEach { widthIdx in (0...heightCellCount).forEach { heightIdx in let node = SCNNode(geometry: cellGeometry) node.position = SCNVector3(Double(widthIdx) * cellSize, Double(heightIdx) * cellSize, 0.0) boardNode.addChildNode(node) } } // With widthCellCount = 4 / heightCellCount = 0 (i.e., 5 actual geometry nodes on screen) // both these lines give me a draw call count of up to 12; without .flattenedClone() it starts smaller // scnScene.rootNode.addChildNode(boardNode.flattenedClone()) scnScene.rootNode.addChildNode(boardNode)
Posted
by ratkins.
Last updated
.