123 mp3 123. Mp3
In USES added mmsystem
Procedure TForm1. Button1Click (Sender: TObject);
The begin
MCISendString (' OPEN d:/1. Mp3 TYPE mpegvideo alias ww ', nil, 0, 0).
MCISendString (' PLAY WW, nil, 0, 0).
end;
So you can play
But it can't reflect the effect of res
The build of the project is copied to the other computer no sound
Would like to ask how to call the res mp3
Thank you very much!
CodePudding user response:
Can use TResourceStream release resource file to diskCodePudding user response:
@ hj8090 great apes is convenient to some code?MCISendString (' OPEN d:/1. Mp3 TYPE mpegvideo alias ww ', nil, 0, 0).
The key is to OPEN the back of the filename
Thank you very much!
CodePudding user response:
Please refer to the following code, check your configuration of parameters, such as: the use of "/" and "",To play file. MID file:
In unit interface reference mmsystem unit.
//play music
MCISendString (' OPEN e: \ 1. MID TYPE SEQUENCER ALIAS NN ', ', 0, 0).
MCISendString (' PLAY NN FROM 0 ', ', 0, 0).
MCISendString (' CLOSE ANIMATION ', ', 0, 0).
end;
//stop play
MCISendString (' OPEN e: \ 1. MID TYPE SEQUENCER ALIAS NN ', ', 0, 0).
MCISendString (' STOP NN ', ', 0, 0).
MCISendString (' CLOSE ANIMATION ', ', 0, 0).
Play MP3 files:
//start playing:
Procedure TForm1. Button1Click (Sender: TObject);
The begin
MCISendString (' OPEN e: \ 1. Mp3 TYPE mpegvideo alias ww ', nil, 0, 0).
MCISendString (' PLAY WW, nil, 0, 0).
MCISendString (' CLOSE ANIMATION ', ', 0, 0).
end;
//stop play
Procedure TForm1. Button2Click (Sender: TObject);
The begin
MCISendString (' OPEN e: \ 1. Mp3 TYPE mpegvideo alias ww ', ', 0, 0).
MCISendString (' STOP ww ', ', 0, 0).
MCISendString (' CLOSE ANIMATION ', ', 0, 0).
end;
CodePudding user response:
@ tanqth thank you!Your code is suitable for the mp3 if this can be automatically play mp3 exe in other computer when there is no sound