Post

Replies

Boosts

Views

Activity

Is AVAudioPCMFormatFloat32 required for playing a buffer with AVAudioEngine / AVAudioPlayerNode
I have a PCM audio buffer (AVAudioPCMFormatInt16). When I try to play it using AVPlayerNode / AVAudioEngine an exception is thrown: "[[busArray objectAtIndexedSubscript:(NSUInteger)element] setFormat:format error:&nsErr]: returned false, error Error Domain=NSOSStatusErrorDomain Code=-10868 (related thread https://forums.developer.apple.com/forums/thread/700497?answerId=780530022#780530022) If I convert the buffer to AVAudioPCMFormatFloat32 playback works. My questions are: Does AVAudioEngine / AVPlayerNode require AVAudioPCMBuffer to be in the Float32 format? Is there a way I can configure it to accept another format instead for my application? If 1 is YES is this documented anywhere? If 1 is YES is this required format subject to change at any point? Thanks! I was looking to watch the "AVAudioEngine in Practice" session video from WWDC 2014 but I can't find it anywhere (https://forums.developer.apple.com/forums/thread/747008).
0
0
754
Feb ’24
Is the Hardened Runtime required for Mac Apps Now?
I just tried submitting an app to be notarized. This app is actually only used by me internally (but I have other apps this question would be relevant to) and I can't submit for notarization. I get the following error: "Hardened Runtime is not enabled." Is the Hardened Runtime now required? I know it used to be optional (I believe the last time I submitted an app update a few months ago outside the Mac App Store I got no such error).
6
0
1.1k
Feb ’24
OSLog Line Numbers & Source File Only Shown On Mouse Hover in Tiny Text?
For awhile I've wrapped OSLog in my own macros to include the line number and source file the logging statement originates from in debug mode because OSLog didn't include that info in console output (until recently). Now I noticed the source code file and line number of the logging statement isn't being shown (I have all the metadata switches turned on in Xcode's console "Metadata Options" popover). Then I realized it is being shown, only on mouse hover over the logging statement in very tiny text. The text is barely readable (on mouse hover). Why would viewing the line number require me to move the mouse cursor over a logging statement? It doesn't look pretty at all (hiding information behind mouse hover) and even if it did look pretty, this is the console for programmers and we don't care about such nonsense.
1
0
826
Dec ’23
Use prebuilt dylib built for macOS in macCatalyst?
Is there a way to link a prebuilt dylib that was built for the 'macOS' platform on Mac Catalyst without being warned by Xcode? Generally it would be better to just recompile for Mac Catalyst but this is a third party library and they have a complicated build system with dozens of dependencies that doesn't support Mac Catalyst as of now (although they have iOS and Mac 'regular'). So I would have to spend quite a bit of time trying to sort through their build system to make a Catalyst version myself. The library uses no platform specific UI code and I'm fairly certain that macOS build would work just fine on Mac Catalyst without any changes since it isn't UI related at all. It seems to work fine (apart from Xcode warning me about linking a .dylib built for macOS on Mac Catalyst). I could shim all this away in a NSBundle that is aware of the AppKit world but then I have to make all method calls to the third party framework on Mac Catalyst through the bundle and it would separate my iOS and Catalyst code relying on the same implementation which isn't great. Is there a way I could just replace the 'macOS' platform in the .dylib with macCatalyst to get rid of the warning?
2
1
1.3k
Nov ’23
CoreML PyTorch Conversion More Samples?
I'm trying to convert a PyTorch forward Transformer model to CoreML but am running into several issues, like these errors: "For mlprogram, inputs with infinite upper_bound is not allowed. Please set upper. bound" 570 • to a positive value in "RangeDim)" for the "inputs" param in ct.convert().' raise NotImplementedError ( 259 "inplace_ops pass doesn't yet support append op inside conditional" Are there any more samples besides https://developer.apple.com/videos/play/tech-talks/10154 The sample in that video an imageType is used as input but in my model text is the input (and the output). I also get warned that converting "torch script" is experimental but in the video it says it a torch script is required to convert (though I know the video is a few years old).
1
0
985
Oct ’23
A Web Page's Javascript Causing an Error in My WKUserScript Loaded in a Custom Content World
I have a global variable in WKUserScript declared as a const in Javascript. I load this script in a custom WKContentWorld I create with my own name (not the pageWorld or default world). There some nasty javascript out there on most popular sites. I noticed that unhandled errors on the page can break stop my WKUserScript from working. In one particular case there is this nasty script on page for ads that uses document.write like so: b.contentWindow.document.write(e), b.contentWindow.document.close() And the web inspector shows an error here "Can't create duplicate variable: 'MyGlobalVariableNameInsMyUserScriptHere'" This script being used on the web page is going to end up getting blocked. But my question is this, isn't using my own content world supposed to protect me against this type of thing? This global javascript variable (an array) is global in my javascript file and holds some data in it but it is not inserted into the DOM. Shouldn't document.write/document.close calls from the page not cause this type of error in my user script? And if the entire DOM is being rewritten shouldn't a new script (representing my user script) be created from scratch? I think I can avoid the error by changing the variable from const to var (haven't tried yet). But is this how it's supposed to be?
1
0
514
Oct ’23
WKWebView -resumeAllMediaPlayback: deprecated Replacement is -setAllMediaPlaybackSuspended:completionHandler:
I see the -resumeAllMediaPlayback: says the replacement method is -setAllMediaPlaybackSuspended:completionHandler: I don't believe suspending and resuming media playback are matching actions, which would mean -resumeAllMediaPlayback: doesn't have a replacement API? The deprecated -resumeAllMediaPlayback: method doesn't seem to work on Sonoma (pauseAllMediaPlaybackWithCompletionHandler: does work but resume does not).
1
0
487
Oct ’23
WKWebView -requestMediaPlaybackStateWithCompletionHandler: Reporting Incorrect Playback State?
So I have a WKWebView with a loaded page. This page is playing an embedded Youtube video. The playback state is WKMediaPlaybackStatePlaying. All good. Then I click a link on the page (navigation jumps to a new page) and the video is no longer playing. No video or audio. The navigationDelegate calls -webView:didFinishNavigation: And my navigationDelegate call -requestMediaPlaybackStateWithCompletionHandler: on the webview from within -webView:didFinishNavigation: And in the completion handler of -requestMediaPlaybackStateWithCompletionHandler: the playback state is WKMediaPlaybackStatePlaying but nothing is playing because we are on a new page.... I even tried calling -requestMediaPlaybackStateWithCompletionHandler: after a delay but that doesn't seem to make a difference (even gave it a delay as long as 5 seconds)
4
0
739
Oct ’23
WKWebView UIDelegate Methods Not Being Called on Mac Catalyst (WKUIDelegate)
I have a WKWebView that sets the UIDelegate: self.webView.UIDelegate = self; The following methods are never called when I right click in the WKWebView to being up a context menu: -(void)webView:(WKWebView*)webView contextMenuForElement:(WKContextMenuElementInfo*)elementInfo willCommitWithAnimator:(id <UIContextMenuInteractionCommitAnimating>)animator -(void)webView:(WKWebView*)webView contextMenuConfigurationForElement:(WKContextMenuElementInfo*)elementInfo completionHandler:(void (^)(UIContextMenuConfiguration * _Nullable configuration))completionHandler - (void)webView:(WKWebView *)webView contextMenuDidEndForElement:(WKContextMenuElementInfo *)elementInfo; This is from a Mac Catalyst app (I'm on macOS 14.0 23A344)
4
0
769
Oct ’23
Jump to Definition on Symbols in a Swift Framework's Gigantic Generated "Header"?
So I'm looking inside the documentation for TipKit, which ~1400 lines in a single file of documentation. If I right click a symbol there is no "Jump to Definition" in the context menu. Steps to reproduce: Navigate to TipKit generated "header". Right click a symbol like Tip (highlighted in bold): public struct AnyTip : Tip 3rd step) No Jump to Definition menu item appears in the context menu. Is this intentional behavior?
2
0
474
Oct ’23
Programmatically Launch an macOS Action Extension?
Is there a way to programmatically launch a macOS Action Extension (related documentation: https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/Action.html) I'm aware how to create "Action Extensions" but they only seem to be activated from NSTextView "rollover" button. Say I know there is an action extension that works on a particular type of data can I launch it from my app? Obviously we can launch "regular" apps with NSWorkspace by bundle iD but I was wondering if there is any API where my app could directly launch an action extension as the "host app" programmatically.
1
0
652
Oct ’23
NSToolbar Draws On Top of "Full Screen" Video Played in WKWebView in Mac Catalyst app
I have a Mac Catalyst app configured like so: The root view controller on the window is a tripe split UISplitViewController. The secondary view controller in the Split View controller is a view controller that uses WKWebView. Load a website in the WKWebview that has a video. Expand the video to “Full screen” (on Mac Catalyst this is only “Full window” because the window does not enter full screen like AppKit apps do). The NSToolbar overlaps the “Full screen video.” On a triple Split View controller only the portions of the toolbar in the secondary and supplementary columns show through (the video actually covers the toolbar area in the “primary” column). The expected results: -For the video to cover the entire window including the NSToolbar. Actual results: The NSToolbar draw on top of the video. -- Anyone know of a workaround? I filed FB13229032
0
0
537
Oct ’23