Ответ: вопросы по работе со звуком
конфигурацию сборки я нашел и установил "midp-2",тип мидлета: классический (я его менять не стал).
midi-файлы стали проигрываться на телефоне.
wav-файлы в эмуляторе проигрываются а в телефоне в этом месте программа выбрасывается.
mp3-файлы даже на эмуляторе не идут.
хотя их открытие происходит: когда в ресурсах присутствует слишком большой mp3-файл, то эмулятор жалуется на недостаточное количество heap-памяти.
вряд ли что-либо в коде программы, но, на всякий случай, прилагаю.
пожалуйста, помогите разобраться!
program NewProject;
function getplay1wav(afilename : string) : boolean;
{проигрывание wav-файла}
begin
getplay1wav:=false;
if not openplayer('/'+afilename+'.wav','audio/x-wav') then halt;
if not setplayercount(1) then halt;
if not startplayer then halt;
delay(getplayerduration);
stopplayer;
getplay1wav:=true;
end;
begin
{if not getplay1wav('exit') then halt;}
drawText('Hello world!', 0, 0);
repaint;
delay(2000);
if not openplayer('/1.mid','audio/midi') then halt;
if not setplayercount(1) then halt;
if not startplayer then halt;
delay(5000);
stopplayer;
delay(1000);
if not openplayer('1.mid','audio/midi') then halt;
if not setplayercount(1) then halt;
if not startplayer then halt;
delay(10000);
stopplayer;
if not getplay1wav('exit') then halt;
if not openplayer('/1.mp3','audio/mpeg') then halt;
if not setplayercount(1) then halt;
if not startplayer then halt;
repeat
delay(100);
until getkeypressed = ke_star;
stopplayer;
if not getplay1wav('EXIT') then halt;
end.
содержимое mpprog-файла проекта:
<Project>
<MIDlet Name="NewProject" Vendor="MIDletPascal" Version="1.0.0" Icon="/icon.png"/>
<Sources>
<source filename="NewProject.mpsrc"/>
</Sources>
<Resources>
<resource filename="icon.png" configurations=":all:"/>
<resource filename="exit.wav" configurations=":all:"/>
<resource filename="1.mid" configurations=":all:"/>
<resource filename="1.mp3" configurations=":all:"/>
</Resources>
<BuildConfigurations>
<configuration name="Default" type="normal" version="2" math="1"/>
<ActiveConfiguration index="0"/> </BuildConfigurations>
</Project>
содержимое jad-файла:
MIDlet-1: NewProject, /icon.png, FW
MIDlet-Jar-Size: 26259
MIDlet-Jar-URL: NewProject.jar
MIDlet-Name: NewProject
MIDlet-Vendor: MIDletPascal
MIDlet-Icon: /icon.png
MIDlet-Version: 1.0.0
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-2.0
|