sound plays in iOS simulator but not on standalone

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
mellington
Posts: 5
Joined: Tue Apr 04, 2017 6:19 pm

sound plays in iOS simulator but not on standalone

Post by mellington » Thu Apr 06, 2017 3:06 am

I cannot get any sound to play on my standalone iOS apps. Audio plays well in the iOS simulator and on my Android smartphone. It makes no difference whether it is purely an audio file or audio encapsulated within a video file, the result is the same: my Android plays audio, my two iPhone 5s phones do not. I have tried several video and audio formats to no avail. Here is an example of my LiveCode:

Code: Select all

on openCard
   if "mobilecontrol" is among the lines of mobileControls() then
      controlDelete
   end if   
   mobileControlCreate "player", "videoControl"  
   mobileControlSet "videoControl", "filename", specialFolderPath("resources") & "/chips.mp4"
   mobileControlSet "videoControl", "rect", "10,10,300,350"  
   mobileControlSet "videoControl", "showController", true  
   mobileControlSet "videoControl", "visible", true  
   mobileControlDo  "videoControl", "play"  
end openCard
on controlDelete
   mobileControlDelete "videoControl" 
end controlDelete
on closeCard
   controlDelete
end closeCard
end openCard

The audio that works in my iOS simulator includes: wav, aiff, au, mp3, aac, mov, and m4a. Yet, none of them work in the standalone apps that I sideload onto my iPhones.

I am using LiveCode Community 8.1.3 with Mac OS 10.10.5 (Yosemite). I got the same results with LiveCode Indy 8.1.3 and several earlier versions of Livecode, including 7.1.2, and with MacOS 10.12 Sierra, and with Xcode 6.3.2. and 7.2.1. Frankly, I don't think it's a Mac OS or Xcode problem.

LiveCode_Panos
Posts: 378
Joined: Fri Feb 06, 2015 4:03 pm

Re: sound plays in iOS simulator but not on standalone

Post by LiveCode_Panos » Thu Apr 06, 2017 1:37 pm

Hi mellington,

I had experienced this problem once, and I found out it was happening because I had accidentally turned off the ringer in the iPhone device :)

So it might be worth double checking this.

Best,
Panos
--

mellington
Posts: 5
Joined: Tue Apr 04, 2017 6:19 pm

Re: sound plays in iOS simulator but not on standalone

Post by mellington » Thu Apr 06, 2017 2:53 pm

Thanks for your reply LiveCode_Panos. The ringer is not turned off. The volume setting of the iPhone is maximized. Both of my iPhones play ordinary music and videos with the audio working perfectly. It is just with my LiveCode installed apps that the audio is entirely absent. The same code which works well on my Android phone (and SDK simulator) and in the iOS simulator, fails to work on my iPhones. This appears to me to be either a serious bug in LiveCode or that I'm missing some necessary LiveCode coding that the iPhone requires to play audio which the Android does not.

LiveCode_Panos
Posts: 378
Joined: Fri Feb 06, 2015 4:03 pm

Re: sound plays in iOS simulator but not on standalone

Post by LiveCode_Panos » Thu Apr 06, 2017 3:02 pm

Hi mellington,

I can successfully play sounds on an iPhone device, in every LiveCode version I have tried.

what does this command return on the iPhone?

Code: Select all

answer there is a file (specialFolderPath("resources") & "/chips.mp4)
If the file is there, but it cannot be played, I suggest you file a bug report at quality.livecode.com, and make sure you include a sample stack as well as the specific audio file.

Best regards,
Panos
--

mellington
Posts: 5
Joined: Tue Apr 04, 2017 6:19 pm

Re: sound plays in iOS simulator but not on standalone

Post by mellington » Thu Apr 06, 2017 6:24 pm

Thanks again for your help LiveCode_Panos. I tried your suggested code: answer there is a file (specialFolderPath("resources") & "/chips.mp4")
The result was "true", as I expected. In my previous debugging attempts I frequently listed (in a card field) all files in the 'resources' folderpath. All the necessary 'copy files' are listed there on the Android standalone, the iOS simulator, and on the iPhone 5s standalone app. Obviously, the files are there, considering the fact the video plays on the iPhone, albeit without audio. Likewise, when I attempt to play a variety of purely audio files on the iPhone standalone, no sound is audible, yet those files are clearly listed in the 'resources' folderpath field. With exactly the same LiveCode those audio files work perfectly on the Android phone and iOS simulator. I am reluctant to file a bug report on this issue unless and until I have exhausted all reasonable suggestions. I strongly suspect there is some coding or preferences inadequacy on my part, because the notion that LiveCode cannot play audio on the iPhone would be very difficult for me to accept.

LiveCode_Panos
Posts: 378
Joined: Fri Feb 06, 2015 4:03 pm

Re: sound plays in iOS simulator but not on standalone

Post by LiveCode_Panos » Fri Apr 07, 2017 7:04 pm

Hi mellington,

Are you able to play sounds on these iPhones in other non-LiveCode apps?

Best,
Panos
--

mellington
Posts: 5
Joined: Tue Apr 04, 2017 6:19 pm

Re: sound plays in iOS simulator but not on standalone

Post by mellington » Fri Apr 07, 2017 9:41 pm

As previously posted:
Both of my iPhones play ordinary music and videos with the audio working perfectly. It is just with my LiveCode installed apps that the audio is entirely absent.

I can play a VLC movie on my iphones and hear the audio perfectly; then stop the VLC app, immediately open my LiveCode app and play the included video—but it has no sound; then re-open VLC or another iphone video player (such as PlayerXtreme) and play a video with sound working normally. Only the LiveCode apps lack audio.

In fact, in the VLC and PlayerXtreme apps on my iPhone 5s, I can play an exact duplicate of the video files I am using in my LiveCode app, via the "copy files" standalone settings, but there is no sound emanating from the Livecode app. This phenomenon also applies to standard music and sound files, such as wav, aiff, au, mp3, aac, mov, and m4a, which all play perfectly on the iPhone and iOS simulator, except when that music is in a LiveCode app installed on the iPhone.

Given the fact that I cannot play ANY sound from ANY LiveCode app which I have sideloaded on my iPhones, leads me to believe either LiveCode has a serious bug in that respect, or there is some standalone setting or installation procedure (i.e. sideloading) that I am doing incorrectly. Whereas the LiveCode app's audio works perfectly in the iOS simulator, I doubt that I have some inappropriate LiveCode standalone settings. The problem seems to be located in the object code the LiveCode compiler creates for the standalone file that I copy to my iPhone via Xcode.

mellington
Posts: 5
Joined: Tue Apr 04, 2017 6:19 pm

Re: sound plays in iOS simulator but not on standalone

Post by mellington » Wed Apr 26, 2017 3:33 am

I resolved the audio issue. It seems to be a bug in LiveCode.

In an earlier post by LiveCode_Pano he suggested that I might have turned off the ringer on the iPhone 5s. I later discovered that I had in fact turned the ringer off and this prevented the audio from working on all of my LiveCode apps. I assumed by 'turned off the ringer' Pano meant that I might have turned down the volume of the phone or “ringer” volume slider in the iOS settings. I made sure both of those audio settings were set to maximum but there was still no audio in my LiveCode apps.

Then I stumbled upon a small ringer switch on the side of the iPhone. When it’s off, all my LiveCode video and audio apps fail to emit audio; while at the same time all my other video and audio apps emit audio perfectly.

Any ordinary iPhone user would be very upset to discover the app they bought from me won’t play audio. I could include a pop-up in my apps that warn users to turn their ringer switch on, but that would be annoying and appear unprofessional, since all their other apps don’t require that inconvenience.

Clearly, this audio dependency on the state of the ringer switch is a LiveCode deficiency—in other words a ‘bug’.

I also recently discovered this bug has been previously reported on the LiveCode Quality Control Center. And yet LiveCode has chosen to ignore this bug and simply suggest the ringer switch be turned on. It’s a negligent response to a serious bug which prevents audio from playing on the iPhone under ordinary operating conditions. You cannot expect a user to know that the state of his ringer switch might be the cause of his LiveCode app not working, while all this other apps play sound normally.

When I can afford the time, I’ll file this bug at the LiveCode Quality Control Center.

Post Reply

Return to “Rich Media”