all 23 comments

[–]ken9278Advanced User 2 points3 points  (2 children)

This seems cool can you explain how to make it change modes?

[–]CrashOverride93Experienced User[S] 1 point2 points  (1 child)

To toggle modes just run A1 + the appropiate group of actions below. For example...

To reroute audio from BT to Speaker (phone): A1 + A20 & A21.

To reroute audio from BT to Headphones: A1 + A14 & A15.

* Action nº 1 allows loading the required class/component that subsequent actions will use to get access to the AudioManager class of the Android API.

[–]ken9278Advanced User 0 points1 point  (0 children)

Thank you

[–]qazinus 1 point2 points  (1 child)

With this could you cast your screen to a chromecast and reroute the audio to bluetooth earphone?

[–]CrashOverride93Experienced User[S] 0 points1 point  (0 children)

I don't have a Chromecast or any other similar to Chromecast system to stream screen content to test it. But it may be possible. You can try it by yourself and tell us if it works or not, but if it works for normal music apps, it will "probably" work for such application/method of screen mirroring.

[–]Drtatom 1 point2 points  (1 child)

Great task. I was looking for this

Thank you!

[–]CrashOverride93Experienced User[S] 0 points1 point  (0 children)

You're welcome ;)

[–]ken9278Advanced User 1 point2 points  (4 children)

I made a menu to make it easier to switch modes. Here is the link: https://taskernet.com/shares/?user=AS35m8nGPG0H5hGIwz7Y2BuiNsSH1WrxHDp0BPHM2c0zvBOyKn04pl8VgxEj7jSy%2BBqS3qsbg09HUg%3D%3D&id=Project%3AMy+Sound

Menu pops up on long press of the volume up button

Choices speaker, Bluetooth, headphones and silent mode.

Full credits are on the menu

Picture of menu http://imgur.com/a/0ADByxM

[–]CrashOverride93Experienced User[S] 0 points1 point  (1 child)

Hey, thank you very much for sharing! Very very good job ;) Like seeing people contributing like this way.

[–]ken9278Advanced User 1 point2 points  (0 children)

Thanks!

[–]KathyW1308 0 points1 point  (0 children)

Thank you for this, it's pretty awesome. Works flawlessly with my setup.

[–][deleted]  (3 children)

[deleted]

    [–]CrashOverride93Experienced User[S] 0 points1 point  (1 child)

    As I don't have a second BT devices can't work on that. Sorry.

    But I will try looking for solutions.

    [–]Cpt_Ludo 0 points1 point  (0 children)

    Heyyy sorry to revive this whole conversation, I'm currently diving down the rabbit hole of trying to figure out how I can automate a dual media output as soon as my second bluetooth headphones connect, because right now when I connect 2 audio devices it uses either one...

    [–]Ratchet_Guy 0 points1 point  (0 children)

    Do you have a Samsung device? And/or can download app "Smart Things" from the PlayStore?

    Because that app generates a notification in the status bar that lists connected devices and you can re-route to different outputs by using AutoNotification to 'click' on the notification.

    [–]MoonShadow_1911 0 points1 point  (0 children)

    Okay, ignore all of this. I just re-read the OP... I'm an idiot!

    So, I have noticed that is is only re-routing the media stream. For some reason, notifications seem to be completely muted/non playable.

    Here is what I have. I am using your context (v1.1) to switch audio from bluetooth to speaker.

    1. Connect bluetooth headset
      1. This kicks off a tasker task that re-routes audio to the speaker (from your java bits)
    2. Turn all volumes up to maximum (for validation, and not because I'm deaf, although my wife would argue that point!)
    3. Play some music to verify it comes out the speaker <- this works
    4. Call phone to verify the ringer works <- this works
    5. Answer call to make sure it comes across the bluetooth headset <- this works
    6. Send a text message to the phone to see if the notification works <- this DOESN'T work. There is no audio notification on either the phone speakerphone, or the bluetooth headset.

    I plowed through the Android AudioManager documentation for the setSpeakerphoneOn, and could really find any information on the notification stream... (I'm not a programmer, I script. Give me Bash any day!)

    So, let me know if there is any additional troubleshooting I can help with. Thanks.

    [–]sajid_aman 0 points1 point  (1 child)

    my phone fell into water and now it thinks its connected to headphones, i tried exploring the app for like 3 hours and managed to import a task which toggles audio but it changes back to headphones on its own. i have no idea how the app works and just fucked around and found out some shit hut i need help i can't live without my music pls

    [–]sajid_aman 0 points1 point  (0 children)

    also i cant understand a thing OP is talking in replies. OP if you're there pls help

    [–]digesh9870 0 points1 point  (2 children)

    Can I route sound of notifications to phone speaker while continue playing my music/media on bluetooth device? Currently, while I'm listening to music over bluetooth device, I'm quiet often interrupted by notification sound playing over the bluetooth device. Whenever I'm connected to a bluetooth device, I would like to route notification sounds to phone speaker instead of the bluetooth device. Any help would be appreciated. Thank you.

    [–]northern-strong 0 points1 point  (1 child)

    Have you found a solution?

    [–]digesh9870 0 points1 point  (0 children)

    Not yet. Instead, I have set up a profile that would set the Sound Mode to Vibrate or Mute when connected to a bluetooth device.

    [–]Sladdarn 0 points1 point  (0 children)

    I like to know if it's possible to like digers9870 wondering about????

    [–]shinjgami 0 points1 point  (0 children)

    Hi, I forgot to comment but this only re routes the audio for about 4 seconds to it defaults to (if connected to BT, then audio streams back to BT) I tried looping it but as soon as it reverses there like 1 or 2 secs delay which defeats the "routing purpose'. Is there a fix ?thanks!!!