Post

Replies

Boosts

Views

Activity

How to cancel SFSpeechURLRecognitionRequest?
Hi, I am trying the speech recognition API. For live recognition, I use SFSpeechAudioBufferRecognitionRequest It works fine in general. But when I try to use file recognition with SFSpeechAudioBufferRecognitionRequest I found that I can't find a way to cancel the recognition? Cancel or kill the request can't stop the call back from result handler. So I need to wait the recognition finish when I receive the result's isFinal flag is true. It make me a little inconvenient if I try to recognize a long audio file and finally decide to cancel the recognition. Are there some ways to cancel the file recognition directly? Thank you~~ Eric
0
0
715
Dec ’21
Failed to load embed dylib in M1?
I met a strange issue. I got error: dyld: Library not loaded: /usr/local/lib/mylib.dylib Reference from: ..... Reason: image not found I didn't suppose that I need to load library from /usr/local/lib, because it already included in my project. The lib is an embed lib of my project and this issue only happened on my M1 mini? I have try three devices even on MacOS 12.0.1 Then I found the "Runpath Search Paths" seems didn't work on M1 machine. All setting among three machine are the same. (The same source code). Even I use the absolute path on this setting on M1 machine didn't work while others two machine without any problem. Does anybody know what happened? Should I add additional setting on my M1 machine? ps: My project has two level, the problem happen on my second level project which is included in the first level project. I am not sure related to this or not?
2
0
987
Dec ’21
Failed to recognize core graphic after update Xcode 13.1?
My code was lived well recently. But today after I update my Xcode 13.1.( It ask me to install some components and I always click yes.) Then all code related to core graphic like this can't work now. Not only the code but also the constant like: kCGImagePropertyExifFlash is failed to be recognized too. Does anybody know what happened?  // Write Image CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef bitmapContext = CGBitmapContextCreate(     pBuffer,     imgInfo.nWidth,     imgInfo.nHeight,     8, // bitsPerComponent     4*imgInfo.nWidth, // bytesPerRow     colorSpace,     kCGImageAlphaNoneSkipLast);
3
0
642
Nov ’21
My app is damaged and can't be opened when porting to M1 ?
I have porting my existing application to support native M1, there a a lot of framework and library that I have already build for both platform. The strange result is when I archive the app on Intel machine. The binary work on Intel platform well. When I archive my application on M1 machine, the app can work on M1 well. But when I try to run app that build on M1 on Intel Machine, then I got the message said my app is damaged and can't be opened. The same situation got for build in Intel platform one. I try "lipo -archs" command on my app and I did get "x86_64 arm64" as result, so my app should already a universal app I guess. Does any body know are there some way to check what happened on my application? Thanks, any opinion will be appreciated ! Eric
3
0
3.6k
Oct ’21
How can I combine two different dylib into a simple one?
Hi, I am trying to build ffmpeg for Intel and M1 platform for my application. I got some problem, because when I put arm64 dylibs I got error that no x86_64 dylibs available. And I got arm64 dylibs not available when I put x86_64 dylibs. Can I combine these two set of dylibs into a single one then I don't need to change the dylibs on different platform? XCFramework or ?? Thank you. Eric
1
0
1.3k
Oct ’21
How can I draw something outside the NSSlider in NSSliderCell?
Hi, I override the drawTickMarks() in NSSliderCell. However, I need to draw some text there and may have a little outside the NSSlider's boundary, so I got some clip in my result. I try to set the maskToBound to false by      self.controlView?.wantsLayer = true     self.controlView?.layer?.masksToBounds = false     self.controlView?.layer?.backgroundColor = CGColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 0.5) So I can clearly see the bounds of slider but the masksToBounds didn't work here. Does anybody know to make the masksToBounds work for my purpose? Thank you~~
1
0
599
Mar ’21
How can I simulate the selection behavior of iPhoto on Mac?
Hi I am using the NSCollectionView to provide the media preview & selection for user. I found the iPhoto application can highlight (with blue border) the selected photo that inside the selection rectangle when I drag mouse ( Didn't go mouse up state yet.) But I can't find the delegate in NSCollectionViewDelegate can help me to implement this feature? Are there any method I can use to implement this feature? I found the delegate shouldChangeItemsAt is called during mouse dragging but the index array is empty? Can I use some setting to make it give me the selected item's array? Thanks Eric
0
0
594
Mar ’21
How can disable the "Move Window to Left Side of Screen" option of window's resize button?
Hi, I am not sure about the real reason of my case, when I use NSWindow of my window's base class, the options (Zoom, Move Window to Left Side of Screen, Move Window to Right Side of Screen, ... etc) that when I hover on the resize button are disabled. But when I change my window's base class to NSPanel, these options are enabled. What I want is disabling all options in the option menu and keeping zoom function only on the resize button. Are there some attribute that I can set to disable these options? Thank you~~ Eric
3
0
1.5k
Feb ’21
Mouse move event between two window..
I use NSTrackingArea and monitor mouseEntered to simulate hover of the NSButton. But I met a problem between two windows. I have a first window A that was a modal window, then I click a button of window A and popup a window B as a dialog (NSPanel with workWhenModal = true). No matter I use [modal] or [show] setting in segue, I got similar result, when hover is available in window A, then it failed on button of window B. If hover is available in window B, then it failed on button of window A. Is there any way that I can detect mouse move event in both window correctly? Or I need to have different implementation to make mouse move event been detected in both window? Thanks, Eric
7
0
1.1k
Jan ’21
More information about gs_instruments.dls?
Hi,I got the gs_instruments.dls from the sample code. But I can't find any information about this file like the program 10 represent which instrument, note 60 represent which note, ..., etc.Does anybody know where can I find these information about this file?Thank you~~ Really thank anybody can give some idea about these issues.regards,Eric
1
0
920
Oct ’16