An iPad app I have been working on for some time uses iPhonePlaySound to play song files put in the Documents folder via iTunes file sharing and this has worked with no problem. Now that iPhonePickMedia is available, that would be a much better way of selecting songs, so I have been trying it out. The odd thing is that iPhonePlaySound works fine on a path delivered from Documents, but stubbornly will not play one via iPhonePickMedia.
So I created a simple stack with just three buttons with the following code:
GetSong
global tSongFile
on mouseUp
iPhonePickMedia "music"
put the result into tSongFile
end mouseUp
PlaySong
global tSongFile
on mouseUp
iPhonePlaySound tSongFile "1"
end mouseUp
SimplePlay
global tSongFile
on mouseUp
play tSongFile
end mouseUp
On the iPad, the song will play with the SimplePlay button, but nothing happens with the PlaySong button (which is the one I need).
There is probably a simple answer to this (as usually happens with me) and I'd be grateful for any help.
TIA
Don
iPhonePickMedia works but strange problem
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: iPhonePickMedia works but strange problem
Don...
Your syntax is a little short.. it looks like that you are looking for 'iphonePlaySoundOnChannel'. Look at p.34 in the iOS release notes
be well
Dixie
Your syntax is a little short.. it looks like that you are looking for 'iphonePlaySoundOnChannel'. Look at p.34 in the iOS release notes
be well
Dixie
Re: iPhonePickMedia works but strange problem
Hi Dixie
Sorry, it was my typing error. Rather than copy and paste the code I typed it in here manually and go it wrong.
Here is a copy and paste from the actual code :
global tSongFile
on mouseUp
iphonePlaySoundOnChannel tSongFile, "1", now
end mouseUp
And it does not work on the iPad. The button changes state but nothing happens. I know that the path in tSongFile is OK because the simple Play command does work.
Sorry, it was my typing error. Rather than copy and paste the code I typed it in here manually and go it wrong.
Here is a copy and paste from the actual code :
global tSongFile
on mouseUp
iphonePlaySoundOnChannel tSongFile, "1", now
end mouseUp
And it does not work on the iPad. The button changes state but nothing happens. I know that the path in tSongFile is OK because the simple Play command does work.