Can't play simple sound on iPhone

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tonymac
Posts: 23
Joined: Thu Jan 05, 2012 9:17 pm

Can't play simple sound on iPhone

Post by tonymac » Mon Dec 19, 2016 5:17 pm

LC 8.1.1 (stable) iMac OSX 10.12.1 XCode 8.1 (This combination allows me to build on the iPhone)

This is the code used on LC's website as an example. Created a simple 1 button script to test but I can't get the sound to play on iOS. This stack works fine on Android phone/PC/Mac desktop but not iPhone 6. Tried playing sound using mobilePlaySoundOnChannel with no success. The sound has been imported and added in the Copy menu standalone settings. Anybody got any other suggestions to try?

on mouseUp
if the environment = "mobile" then
put specialFolderPath("engine") & slash & "NextCard.aiff" into NextCardSound
play NextCardSound
--mobilePlaySoundOnChannel NextCardSound,"current","now"
else
play "NextCard.aiff"
end if
end mouseUp

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 844
Joined: Fri Feb 06, 2015 4:03 pm

Re: Can't play simple sound on iPhone

Post by LiveCode_Panos » Mon Dec 19, 2016 6:10 pm

Hi Tony,

I can successfully play a .aiff sound file on iOS, on both Simulator and iPhone 6s device.

Things to check:
1. if the .aiff file is included in the standalone
2. if the path to .aiff file is valid
3. if you have muted sounds on the device (happened to me in the past)

Best,
Panos
--

tonymac
Posts: 23
Joined: Thu Jan 05, 2012 9:17 pm

Re: Can't play simple sound on iPhone

Post by tonymac » Mon Dec 19, 2016 7:04 pm

O-o-o-o... what's that little button on the left side above the volume control buttons on this iPhone 6? Oh wait a minute... it's a MUTE button.

My bad everybody... I'm an Android person and had just got a hand-me-down iPhone 6 from my daughter that I'm using to test and develop LC apps on. Thanks for the hint Panos.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2722
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Can't play simple sound on iPhone

Post by jmburnod » Sun Sep 22, 2024 1:25 pm

Hi All,
I can use play .aif files with LC 9.6.6 but one user told me it doesn't work on iOS 17.
Is there a way to do it ?
Kind regards
Jean-Marc
https://alternatic.ch

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2722
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Can't play simple sound on iPhone

Post by jmburnod » Tue Oct 01, 2024 1:35 pm

Hi All,
Sorry for this, that was an error, play .aif file works well
Kind regards
Jean-Marc
https://alternatic.ch

Post Reply

Return to “iOS Deployment”