Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
sound.Player() only outputs on earphone, not BT device when connected
-
I am using the sound library to play mp3 files. On a phone the output only happens on the small earphone speaker, not a BT device when connected. This happens regardless of if the mute switch is on or off.
In other words, I connect a BT speaker, and audio plays there fine from apps like Music or podcast apps. But if I play an mp3 file via sound.Player(), it continues to only play via earphone speaker.
Any workaround?
-
@robot1125 perhaps due to this Pythonista issue
-
@cvp Could be! Seems like the issue has been open since May, so doubt there will be a fix any time soon :(.
-
-
@robot1125 could you check if, in IOS settings, Pythonista is authorized to use Bluetooth
In settings, scroll until Pythonista app is reached
-
@cvp Interestingly, Bluetooth isn't even on the list for Pythonista, much less being toggled off. I believe the only way for it to get there is for the app to request access to the resource.
Do you know how to "make" Pythonista request access to Bluetooth?
-
@robot1125 I think that I never have requested access to BT service. If I use one of samples of CB module doc, I see the list of discovered peripherals, without any problem.
-
@robot1125 found in Apple Support
If there's an app that you use with the Bluetooth accessory,
go to Settings > Privacy & Security > Bluetooth on your iOS or iPadOS device,
and make sure that you've turned on Bluetooth for the app. -
@robot1125 did you check your setting explained in previous post?
And could you run this little script and post result
import cb class MyDelegate (object): def did_update_state(self): # State was updated (e.g. Bluetooth powered on/off) pass delegate = MyDelegate() cb.set_central_delegate(delegate) print(cb.get_state()) ''' https://developer.apple.com/documentation/corebluetooth/cbmanagerstate Manager States case poweredOff 4 A state that indicates Bluetooth is currently powered off. case poweredOn 5 A state that indicates Bluetooth is currently powered on and available to use. case resetting 1 A state that indicates the connection with the system service was momentarily lost. case unauthorized 3 A state that indicates the application isn’t authorized to use the Bluetooth low energy role. case unknown 0 The manager’s state is unknown. case unsupported 2 A state that indicates this device doesn’t support the Bluetooth low energy central or client role '''