Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no sound on iOS 11 #26

Closed
jhancock opened this issue Jan 21, 2018 · 4 comments
Closed

no sound on iOS 11 #26

jhancock opened this issue Jan 21, 2018 · 4 comments

Comments

@jhancock
Copy link

Our app plays sound on iOS 10, but after upgrade to iOS 11, the mp3s don't have any sound. They do seem to be "playing" as we can time aspects of the app to see that a event doesn't happen until after the file should have completed. But no volume. We can hear the sound on the simulator but not the iPad or iPhone device. We've played with the volume setting and a few others but no luck. Debugging doesn't show any errors. The sound objects look about right.
Any ideas to debug this?

@adamcichy
Copy link
Owner

Can you please share the mp3 file?

@jhancock
Copy link
Author

Hi Adam, the mp3s are of my 12 year son reading. I'm not too comfortable posting these public...I know...the app it sits in is sort of public on the AppStore...anyhow...hope you won't mind if I ping you over email.

The key part of code that creates and uses the Sound object is:

    let url = Bundle.main.url(forResource: fileName, withExtension: "mp3")!
    pageTextSound = Sound(url: url)
    pageTextSound.volume = 1.0  // added after bug surfaced to ensure we have volume set
    pageTextSound.play()  { completed in
        if self.readToMe == true {
            self.run(SKAction.sequence([self.readToMeNextPageDelay, SKAction.run { self.nextPage() } ]))
        }
    }

I've added various debug output and stepped through with debugger and it seems all is working as expected. This is a children's storybook. Each page's sound has different time lengths. You can see "completed in" block...the block does only trigger after the correct time for that page's length has passed. It seems like the mp3 is playing...just no sound on the device...only get sound on simulator (iOS 10 and 11) and on device (iOS 10).

@adamcichy
Copy link
Owner

@jhancock No problem at all, you can send the file to me at adam@moonlightapps.com

@jhancock
Copy link
Author

Hi Adam...all clear. As near as I can tell the problem may have been with the ringer on the phone being off. We are fairly certain this didn't effect things on iOS 10, but does seem to surface on iOS 11.
Anyhow...not a bug with your excellent library. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants