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

[HELP]:use flutter soundplay to play url ,and setSpeakerphoneOn true both android and ios did work.i need a solution help #1105

Open
yuanting2016 opened this issue Oct 18, 2024 · 1 comment
Labels
help wanted Extra attention is needed Not yet handled

Comments

@yuanting2016
Copy link

yuanting2016 commented Oct 18, 2024

i use flutter sound to play url,and to change audiomanager
fun changeToSpeaker(context: Context?, isSpeaker: Boolean) {
if (context != null) {
val audioManager = context.getSystemService("audio") as AudioManager
audioManager.setSpeakerphoneOn(isSpeaker)
if (!isSpeaker) {
audioManager.setMode(0)
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
} else {
audioManager.setMode(AudioManager.MODE_IN_CALL);
}
}
}
}
but the volume of the voice played did not change

@yuanting2016 yuanting2016 added help wanted Extra attention is needed Not yet handled labels Oct 18, 2024
@Larpoux
Copy link
Collaborator

Larpoux commented Oct 18, 2024

Hi @yuanting2016

Do you have any problem to run a player or a recorder?
If you are a beginner on Flutter Sound, I suggest that you look to the very simple examples to start.

If you have a specific problem, please explain what is your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Not yet handled
Projects
None yet
Development

No branches or pull requests

2 participants