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.
record sound but cant replay it in speaker
-
import sound import dialogs recorder = sound.Recorder('speech.m4a') #recorder.record() dialogs.alert('Recording...', '', 'Finish', hide_cancel_button=True) #recorder.stop() p=sound.Player('speech.m4a') p.play()
When I comment that record code, the sound came out from the speaker.
but when i use the record code,the player sound come from the headphone.
how can i record sound and replay it in speaker at once?
thx
-
I had same problem with you.
i think there’s a bug about mute switch when recording.
anyway if you do like this, you can play sound in speaker again.
sound.set_honors_silent_switch(False)
-
I think OMZ should add a method to sound module to control the audio routing. For now you can use objective-c calls after recording / before playing:
import objc_util au = objc_util.ObjCClass("AVAudioSession").sharedInstance() # force playback on speaker au.setCategory_withOptions_error_("AVAudioSessionCategoryPlayback",1,None)