Playing a wav on ios
Posted: Fri Feb 27, 2015 3:13 pm
Hi
I am trying to play a wav on an iphone when I fire a bullet in a game.
I have added the Laser2.wav to the standalone application 'copy files' area and the application compiles and deploys OK
I have the code below
command fireDart
local tSound
set the itemDelimiter to "/"
put item 1 to -2 of the filename of this stack into tSound
play tSound & "/Laser2.wav"
Put the loc of button"Malien1" into alienpos
if not exists(button "buttonShot") then
clone the button "shotTemplate"
set the name of the last button to "buttonShot"
end if
set the loc of button "buttonShot" to alienpos
put false into fireable
end fireDart
I have also tried
Play specialFolderPath("engine") & "/Laser2.wav"
In both cases the path seems correct but when I fire the bullet the sound doesn't play, the bullet fires and I am then completely thrown out of the application running on the iphone.
The exact same code works fine on the MAC.
If I take the sound playing element of the code out it works fine on the iphone but clearly no sound.
I am using the latest version of Livecode
Any suggestions please?
I am trying to play a wav on an iphone when I fire a bullet in a game.
I have added the Laser2.wav to the standalone application 'copy files' area and the application compiles and deploys OK
I have the code below
command fireDart
local tSound
set the itemDelimiter to "/"
put item 1 to -2 of the filename of this stack into tSound
play tSound & "/Laser2.wav"
Put the loc of button"Malien1" into alienpos
if not exists(button "buttonShot") then
clone the button "shotTemplate"
set the name of the last button to "buttonShot"
end if
set the loc of button "buttonShot" to alienpos
put false into fireable
end fireDart
I have also tried
Play specialFolderPath("engine") & "/Laser2.wav"
In both cases the path seems correct but when I fire the bullet the sound doesn't play, the bullet fires and I am then completely thrown out of the application running on the iphone.
The exact same code works fine on the MAC.
If I take the sound playing element of the code out it works fine on the iphone but clearly no sound.
I am using the latest version of Livecode
Any suggestions please?