Jump to content

Search the Community

Showing results for tags 'avaudiosession'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
  • Delphi General Discussions
    • Tips / Blogs / Tutorials / Videos
    • Delphi Third-Party
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Found 1 result

  1. Hi there, I was trying to extend the iOSapi_AVFoundation.pas module, by adding the following function to the AVAudioSession function setCategoryWithOptionsError( category: NSString; withOptions : AVAudioSessionCategoryOptions; error: NSError): Boolean; cdecl; Unfortunately its crashing with an object is nil error, what do I miss here ? I make a local copy of the unit, and the following additions: uses ... const AVAudioSessionCategoryOptionDuckOthers = 2; //S4: add 14.05.20 ... type AVAudioSessionCategoryOptions = NSUInteger; //S4: add 14.05.20 AVAudioSessionClass = interface(NSObjectClass) ['{B24932F9-3C98-44E4-A4F6-0CB58AF7DE8A}'] //S4: 14.05.20 new GUID {class} function sharedInstance: Pointer; cdecl; end; AVAudioSession = interface(NSObject) ['{0B02D5EC-ED09-421A-84BE-6CEE08420E14}'] //S4: 14.05.20 new GUID ... //S4: Addition 14.05.20, the new function I need //[MethodName('setCategory:withOptions:error:')] function setCategoryWithOptionsError( category: NSString; withOptions : AVAudioSessionCategoryOptions; error: NSError): Boolean; cdecl; ... end. This is derived from the function in the Apple reference https://developer.apple.com/documentation/avfoundation/avaudiosession/1616442-setcategory Could be looking in Objective-C like this AVAudioSessionCategoryOptions AVAudioSessionCategoryOptionsNone = 0; [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionsNone error:nil]; I want to call it like this LAVAudioSession := TAVAudioSession.Wrap( TAVAudioSession.OCClass.sharedInstance ); //<-- This is original method, it still can be called without exception LRes := LAVAudioSession.setCategory( AVAudioSessionCategoryPlayback, LError); //<-- This is the new method, crash with exception LRes := LAVAudioSession.setCategoryWithOptionsError( AVAudioSessionCategoryPlayback, AVAudioSessionCategoryOptionDuckOthers, LError); Do I have a stupid typo somewhere ? Can the two modules not coexist, because the old one is linked somewhere else ? Shall I use different GUID for the interfaces, or keep the same, to allow static links to find them ? Is the new method not yet in the Rx10.3.3 libraries, but I updated to latest SDK 13.4.1, they should be in there and FMX able to resolve it ? Does the module need to be initialized somehow ? Is there something missing what is needed for correct linkage ? Maybe its too late already, or I'm to blind to see.