I try to upload this application to mac store and i receive this error :
ITMS-90300: Deprecated API Usage - Apple will stop accepting submissions of apps that use QuickTime or QTKit APIs .
the app is very simple , it play an audio file .
below the unit declarations.
Many components in Delphi use deprecated macOS APIs; get over it. Instead of waiting for a fix (which might never come), write your own code, especially if all you need is playing a sound file. Something like:
procedure TForm1.Button1Click(Sender: TObject);
aURL := TNSURL.Wrap(TNSURL.OCClass.URLWithString(StrToNSStr('/PathToYour/File.wav')));
Player := TAVAudioPlayer.Wrap(TAVAudioPlayer.Alloc.initWithContentsOfURL(aURL, nil));
You'll find many other useful methods at https://developer.apple.com/documentation/avfoundation/avaudioplayer?language=objc
i tied this solution , no error at runtime but no sound , anything is missing ?
i am running OS X Catalina
Could be a codec-related problem. I've just tried it with a plain vanilla WAV file, and it works just fine. Here is the file I tested: https://www.dropbox.com/s/t1hh58j873ejfox/APPLAUSE.WAV?dl=0
Remember that paths and file names are case-sensitive and that your instance of AVAudioPlayer class should not be a local variable.
your file is working , an mp3 or a stereo wav done by garageband do not play , all files are on the desktop
That's not related to Delphi then. Apparently, there is either something in the file that the AVFoundation framework in macOS cannot decode, or it's a permission issue.
If it's the former, check out https://developer.apple.com/library/archive/documentation/MusicAudio/Conceptual/CoreAudioOverview/SupportedAudioFormatsMacOSX/SupportedAudioFormatsMacOSX.html .
If it's the latter, try to read the file contents first and then use initWithData() rather than initWithContentsOfURL. If this is a permission issue, your code will fail the moment you try to read the file contents. Or, try the same code on Mojave, where accessing the desktop folder doesn't require any special permissions.