Einzelnen Beitrag anzeigen

Benutzerbild von Union
Union

Registriert seit: 18. Mär 2004
Ort: Luxembourg
3.490 Beiträge
 
Delphi 7 Enterprise
 
#6

AW: Sound auf iOS Gerät abspielen

  Alt 9. Jan 2014, 10:55
Es gibt AudioServicesPlaySystemSound, so geht das:
Delphi-Quellcode:
interface
  procedure PlaySystemSound(ASoundId : integer);

implementation

uses
  MacApi.CoreFoundation, iOSapi.Foundation;

const
  libAudioToolbox = '/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox';
  kSystemSoundID_vibrate =$FFF;

procedure AudioServicesPlaySystemSound(inSystemSoundID:Integer); cdecl; external libAudioToolbox name _PU + 'AudioServicesPlaySystemSound';

procedure PlaySystemSound(ASoundID : integer);
begin
  AudioServicesPlaySystemSound(ASoundID);
end;
Die gewünschten Konstanten-Werte mußt Du Dir aus dem INet zusammensuchen. Einige davon sind auch Gerät-/Plattformabhängig (spezifisch für Mac, iPhone, iPod).

Import des SDK-FW für die Audiotoolbox nicht vergessen!

Einige IDs findet man u.A. dort.
Ibi fas ubi proxima merces
sudo /Developer/Library/uninstall-devtools --mode=all

Geändert von Union ( 9. Jan 2014 um 11:07 Uhr) Grund: Link hinzugefügt
  Mit Zitat antworten Zitat