كيف أضع ملف الصوت داخل التطبيق مع السورس
#11
  public
    { Public declarations }
      procedure PlayAudio_android(myresource: string);
  end;

var
  Form3: TForm3;
switch:boolean=false;
i:integer;
implementation

{$R *.fmx}
{$R *.SmXhdpiPh.fmx ANDROID}

procedure TForm3.Button2Click(Sender: TObject);
begin
MediaPlayer1.Stop;
end;

procedure TForm3.Button3Click(Sender: TObject);
begin
i:=1;
;(PlayAudio_android('Resource_1
end;

procedure TForm3.PlayAudio_android(myResource: string);
var
  Stream: TResourceStream;
  myfile: string;

begin

  Stream := TResourceStream.Create(HInstance, myresource, RT_RCDATA);
  try
    case i of

  1: myfile := TPath.Combine(TPath.GetDocumentsPath, 'Track1.mp3') ; //your resource_1
  2: myfile := TPath.Combine(TPath.GetDocumentsPath, 'mou3inewadih.3gp'); //your resource_2
         end;
    Stream.Position := 0;
    Stream.SaveToFile(myfile);
    MediaPlayer1.FileName := myfile;
    MediaPlayer1.Play;

  finally
    Stream.Free;
  end;

end;


procedure TForm3.Button1Click(Sender: TObject);
begin
i:=2;
PlayAudio_android('Resource_2');
end;

end.
الرد
#12
(21-07-2016, 08:29 PM)jeanjamil كتب :   Stream := TResourceStream.Create(HInstance, myresource, RT_RCDATA);
  try
    case i of
  1: myfile := TPath.Combine(TPath.GetDocumentsPath, 'Track1.mp3') ; //your resource_1
  2: myfile := TPath.Combine(TPath.GetDocumentsPath, 'mou3inewadih.3gp'); //your resource_2
         end;
    Stream.Position := 0;
    Stream.SaveToFile(myfile);
    MediaPlayer1.FileName := myfile;
    MediaPlayer1.Play;
شكرا لك أخي جزاك الله خير 

اشتغل معايه بطريقة هذي 
http://community.embarcadero.com/blogs/e...ndroid-366
اللهم علمنا ما ينفعنا و انفعنا بما علمتنا وَ زِدْنا علماً
الرد


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم