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

Sound only playing through headphones #16

Closed
takaoandrew opened this issue May 30, 2018 · 3 comments
Closed

Sound only playing through headphones #16

takaoandrew opened this issue May 30, 2018 · 3 comments

Comments

@takaoandrew
Copy link

Does anyone know why this might be happening? I have tried to use this package on multiple ios devices and the sound only plays if there are headphones attached. Works fine on android. Is this some sort of permissions issue?

@takaoandrew
Copy link
Author

My only guess is that the file type (mp3) is only able to play through headphones. I am downloading mp3 files from firebase and playing them locally. My log messages look the same whether the headphones are plugged in or not.

With headphones, sound plays:
flutter: attempting to play /var/mobile/Containers/Data/Application/1A17D73F-0130-4A6B-A1F4-B44ECAB4EF3E/Documents/English_mit_filler_David.mp3
iOS => call play
iOS => playerId dd4d9d29-2188-4795-abfb-6d785c6c19a7
play!
isLocal: 1 1
volume: 1.000000 1
togglePlay /var/mobile/Containers/Data/Application/1A17D73F-0130-4A6B-A1F4-B44ECAB4EF3E/Documents/English_mit_filler_David.mp3
ios -> updateDuration...nan
ios -> onTimeInterval...
flutter: _AudioAppState.setPositionHandler => p 0:00:00.000000
ios -> onTimeInterval...
player status: 1
ios -> updateDuration...19.435102
ios -> invokechannel
flutter: _AudioAppState.setPositionHandler => p 0:00:00.000000
ios -> onTimeInterval...
ios -> onTimeInterval...
flutter: _AudioAppState.setDurationHandler => d 0:00:19.435000
flutter: _AudioAppState.setPositionHandler => p 0:00:00.000000
flutter: _AudioAppState.setPositionHandler => p 0:00:00.000000
ios -> onTimeInterval...
flutter: _AudioAppState.setPositionHandler => p 0:00:00.200000
ios -> onTimeInterval...
flutter: _AudioAppState.setPositionHandler => p 0:00:00.401000
ios -> onTimeInterval...
flutter: _AudioAppState.setPositionHandler => p 0:00:00.600000
ios -> onTimeInterval...

Without headphones, no sound in speakers:
flutter: attempting to play /var/mobile/Containers/Data/Application/1A17D73F-0130-4A6B-A1F4-B44ECAB4EF3E/Documents/English_mit_filler_Dropbox.mp3
iOS => call play
iOS => playerId 60dc6e8c-4619-4abb-812d-33dcb03f23a8
play!
isLocal: 1 1
volume: 1.000000 1
togglePlay /var/mobile/Containers/Data/Application/1A17D73F-0130-4A6B-A1F4-B44ECAB4EF3E/Documents/English_mit_filler_Dropbox.mp3
ios -> updateDuration...nan
ios -> onTimeInterval...
ios -> onTimeInterval...
ios -> onTimeInterval...
flutter: _AudioAppState.setPositionHandler => p 0:00:00.000000
player status: 1
ios -> updateDuration...28.682449
ios -> invokechannel
flutter: _AudioAppState.setPositionHandler => p 0:00:00.000000
flutter: _AudioAppState.setPositionHandler => p 0:00:00.000000
flutter: _AudioAppState.setDurationHandler => d 0:00:28.682000
ios -> onTimeInterval...
ios -> onTimeInterval...
flutter: _AudioAppState.setPositionHandler => p 0:00:00.000000
flutter: _AudioAppState.setPositionHandler => p 0:00:00.000000
ios -> onTimeInterval...
flutter: _AudioAppState.setPositionHandler => p 0:00:00.201000
ios -> onTimeInterval...
flutter: _AudioAppState.setPositionHandler => p 0:00:00.401000
ios -> onTimeInterval...
flutter: _AudioAppState.setPositionHandler => p 0:00:00.601000
ios -> onTimeInterval...

@luanpotter
Copy link
Member

I have no idea why this would be the case, it makes no sense to me.

Also, I don't have any iDevices to test with, maybe @feroult can help us out?

@takaoandrew Could you try to test with other file formats to test your theories about MP3? That would narrow it down a lot (maybe wavs, oggs, etc will have better results).

@luanpotter
Copy link
Member

Fixed by #41. Thanks @tsun424!

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

No branches or pull requests

2 participants