Is it possible to redirect data (music) from aux over bluetooth?

I am currently on a project, where I try to send music over bluetooth to a microcontroller. My thing is I would like to redirect the data which is on the aux port and send it directly. So that I wouldn’t have to write an app where I play the music and could instead use the normal music player.

So the plan would be just to pair my telephone with the microcontroller and when music is played on the telephone it is directly transfered to the microcontroller.

My question, is this possible? If so how? (AFAIK normal bluetooth speaker are doing the same)

If this is possible could someone explain, where I can start? Would be awesome.

Thanks in advance. Dimfred

InputStream останавливает приложение при чтении с Bluetooth через

Пытаюсь прочитать информацию, отправляемую на телефон по блютуз модулю HC-06. Использую нижеописанный код. Но каждый раз, когда происходит btThread.start() и код доходит до строки, приложение останавливается. Ошибки нет, приложение не падает, но ничего не происходит и нажать ничего нельзя. Похоже на остановку главного потока, но я же запуска в отдельном.

public class FragmentInfoControl extends Fragment {     private BluetoothSocket socket;     private Handler handler;     private StringBuilder stringBuilder;     private Button bSendMessage;    @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {     super.onCreateView(inflater, container, savedInstanceState);      RelativeLayout parent = (RelativeLayout) inflater.inflate(R.layout.fragment_info_control, container, false);     NestedScrollView scrollInfo = parent.findViewById(;     ScrollView nsvButtons = parent.findViewById(;      final ThreadBT  btTread = new ThreadBT(socket);;        final TextView textView = parent.findViewById(;       handler = new Handler() {         @Override         public void handleMessage(Message msg) {             byte[] readBuffer = (byte[]) msg.obj;             String result = new String(readBuffer, 0, msg.arg1);             stringBuilder.append(result);             Log.i("checkMessage", stringBuilder.toString());             textView.setText(stringBuilder.toString());         }     };      LinearLayout linearButtons = new LinearLayout(getContext());     LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,             ViewGroup.LayoutParams.WRAP_CONTENT);     linearButtons.setOrientation(LinearLayout.VERTICAL);     linearButtons.setLayoutParams(params);      final float scale = getContext().getResources().getDisplayMetrics().density;     LinearLayout.LayoutParams paramsButton = new LinearLayout.LayoutParams((int) (50 * scale + 0.5f),             (int) (60 * scale + 0.5f));     paramsButton.bottomMargin=10;     paramsButton.topMargin = 10;     paramsButton.setMarginEnd(10);     for(int i = 0; i < 12; i++) {         final Button b = new Button(getContext());         b.setLayoutParams(paramsButton);         b.setBackgroundColor(Color.parseColor("#d5e9f1"));         if(i == 10) {             b.setText("s");         } else if(i == 11) {             b.setText("f");         } else {             b.setText(Integer.toString(i));         }          b.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 btTread.write(b.getText().toString().getBytes());              }         });         linearButtons.addView(b);     }     nsvButtons.addView(linearButtons);      return parent; }   public void setSocket(BluetoothSocket mySocket) {     socket = mySocket; }  private class ThreadBT extends Thread {     private final InputStream input;     private final OutputStream out;     private BluetoothSocket socket;     private Handler handler;      public ThreadBT(BluetoothSocket socket1) {         socket = socket1;         InputStream tmpIn = null;         OutputStream tmpOut = null;         try{             tmpIn = socket.getInputStream();             tmpOut = socket.getOutputStream();             Log.i("sendMessage",  "1");         } catch (Exception e) {             e.printStackTrace();             Log.e("sendMessage", "errooooooooor");         }          input = tmpIn;         out = tmpOut;      }       @Override     public void run() {         Log.i("sendMessage", "2");         byte[] buffer = new byte[1024];         int bytesCount;             try{                while(true) {                    if(input.available() > 0) {                        bytesCount =;                        String str = new String(buffer);                        Log.i("sendMessage", "lol" + str);                    }                 }             } catch(IOException e) {                e.printStackTrace();             }         }        public void write(byte[] msg) {         try{             Log.i("sendMessage", new String(msg));             out.write(msg);         } catch (Exception e) { e.printStackTrace(); }     }   } 


Пересмотрел всю документацию, что нашел. Вроде делаю все как в примере, но не выходит.

Bluetooth priority in calls: smart watch vs headset?

I have a Galaxy S4 running 5.0.2. I currently use an LG Tone headset. I am considering getting a smart watch (probably the Samsung Gear S2 or similar). I think I want the one without its own cellular radio; I just want to make calls via the watch on occasion.

But if I have both the watch and the headset connected at the same time, is there any way to predetermine which device gets priority? Or does that totally depend on which device I use to answer a call? If I place a call through the watch, is it a given that the audio will route to the watch? Or is it possible I could wind up talking to the watch and listening to the headset?

Cannot connect multiple PS4 controllers through bluetooth

I have two PS4 controllers but I’m unable to connect both by bluetooth on my iMac and Mac Book Pro, both running Mojave.

I can pair one of them (say A) and, as soon as I do it, the other one (say B) is not recognized through bluetooth. When I set it to be discoverable, the white light blinks for a while and nothing happens. The weirdest thing is that if I disconnect A and try to connect B, it won’t be recognizable unless I run:

sudo rm -R /Library/Preferences/

So what happens now is that I can pair A to my iMac and B to my Mac Book Pro, but not both to neither of them.

I have been googling this problem for a while but haven’t found a solution or even a reason for this to make sense.

bluetooth not available: Mojave 10.14.2

I have a MacBook Pro Retina (2015). Since I have updated to OS Mojave, the Bluetooth has stopped working. I get an error message that “No Bluetooth Hardware Found”.

I have already tried to do the following:

  1. Go to the /Library/Preferences and deleting the file
  2. Successfully resetting SMC. (pressing Shift+ctrl+alt + power button)
  3. Removing the Bluetooth icon from the menu bar

None of the above solutions has worked for me.

Can the mac’s bluetooth name be changed without changing the computer/network name/hostname?

I have some bluetooth headphones which read out the name of the devices it connects to. My corporate MacBook Pro has a specific hostname, so when I connect to the headphones I hear a really long, random alphanumeric string.

If I was able to change the Computer name in the Sharing preferences pane it will rename the Bluetooth name, but is there a way to rename the bluetooth name only, leaving the computer name and network hostname alone?

Microphone not working when connected to Bluetooth FM transmitter

When connected to my FM transmitter, I am able to hear audio from calls but they can hardly hear me.

Similarly, if I want to use Google Assistant, I have to shout. I believe the issue is that a microphone on the transmitter is being used as opposed to the microphone on my phone, and this microphone is bad. However, this has always been an issue, even when the device was new 3 years ago.

I can’t seem to find info on the exact model of transmitter that I have, but this was the title on Amazon: Car FM Transmitter W 2.4A USB Charger, Nulaxy™ 2015 Newest Wireless Bluetooth FM Transmitter Car Kit for All Smartphones, Tablets, MP3 Players Sold by: DinoSonics

It seems like there should be a setting for choosing which microphone to use when connected to a Bluetooth device, but this doesn’t appear to be an option. For reference, I am currently using a Pixel 3, however the same issue was present with a Pixel 2, Droid Turbo 2, and Galaxy S5, obviously on many versions of Android. If this is the wrong board to ask this question or if any more information is needed, let me know.