Audio changes in iOS 8

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Audio changes in iOS 8

Post by teacherguy » Mon Oct 13, 2014 10:26 pm

I have a app that helps students identify musical rhythms. Here is an example of how I have been playing two 8th notes:

Code: Select all

iphonePlaySoundOnChannel tSound ,1,"now"
            wait tHalf milliseconds with messages
            iphonePlaySoundOnChannel tSound ,1,"now"
            wait tHalf milliseconds with messages
Of course there are other variations, but you can see that the idea is very simple. The sound sample is about four seconds long, so it sustains during the "wait" code and then as you see it is re-triggered.

This has been working very well on iOS 7, but now with iOS 8 two things have taken place:

1. My app plays the audio noticeably slower
2. The audio is very staccato, meaning that in iOS 7 the sound was sustaining nicely until the next sound began, but now the sounds are truncated.

Since I currently have some iPads running one OS or the other, it is easy to compare, and clearly Apple has changed something. I mean, it could just be that iOS 8 is more taxing on the processor (clearly, it is) but it would seem to me that the samples should still behave properly, albeit slower.

Any thoughts appreciated.

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Audio changes in iOS 8

Post by teacherguy » Tue Oct 14, 2014 12:02 am

Experimenting:

I decided to alternate channels to see if I could get the sounds to dovetail more effectively. It's better, but still not as smooth as it was in iOS7..there is still a little gap.

String of 8th notes:

Code: Select all

iphonePlaySoundOnChannel tSound ,1,"now"
   iphonePlaySoundOnChannel tClick ,2,"now"
   wait tHalf milliseconds with messages
   wait tHalf milliseconds with messages
   iphonePlaySoundOnChannel tSound ,2,"now"
   mobileStopPlayingOnChannel 1
   wait tHalf milliseconds with messages
   wait tHalf milliseconds with messages
   iphonePlaySoundOnChannel tSound ,1,"now"
   mobileStopPlayingOnChannel 2
   wait tHalf milliseconds with messages
   wait tHalf milliseconds with messages
   iphonePlaySoundOnChannel tSound ,2,"now"
   mobileStopPlayingOnChannel 1
   wait tHalf milliseconds with messages
   wait tHalf milliseconds with messages

Post Reply