Android Question How to record by bluetooth mic?

Discussion in 'Android Questions' started by dreamworld, Oct 14, 2013.

  1. dreamworld

    dreamworld Active Member Licensed User

    As far as I know, the mic of bluetooth devices can only make phone call. It can not be used to record sound.
    Is there a way to record sound by bluetooth mics?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. dreamworld

    dreamworld Active Member Licensed User

    What's your point?
    That app is what I want.
    So how to control the mic of a device?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    No point. Just trying to help you.

    Not all devices allow you to record from a Bluetooth device. The first step is to test whether your device supports it or not.
     
  5. Indy

    Indy Active Member Licensed User

    Hi Erel,

    Assuming the device does allow recording from BT, how do we acheive this? I actually have a requirement of an app which needs to record from BT. I have used AudioRecorder lib to test the mic recording, which works fine, however, there's no mention of BT. Will that just happen automatically if the headset is paried?

    Thanks
     
  6. Erel

    Erel Administrator Staff Member Licensed User

  7. Indy

    Indy Active Member Licensed User

    Hi Erel,

    I had a look at the developer page as you suggested, however, I can't figure out which constant it is. Could you please advise? I've built my app and everything is working perfectly, just need to add the BT part.

    Thanks
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    There isn't any constant specific to Bluetooth. Try to use the default source or mic (0 or 1).
     
  9. Indy

    Indy Active Member Licensed User

    Hi Erel,

    I don't think I have a grasp on this, I must be missing something. I set the default as you suggested but still no Bluetooth recording, it was still being picked up from the mic. Am I supposed to setup some sort BT connection from code? I took a look at your Walkie Talkie app and didn't see anything in there to do with setting the recording source, there was lots of code regarding BT setup and pairing. Is that what I'm missing?

    Thanks
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    No. It should be handled by the OS. However as I wrote in post #4 it is possible that your device doesn't support it.
     
  11. Indy

    Indy Active Member Licensed User

    I checked by using an app call Tape Recorder and it worked, recorded from my Bluetooth device, so yes, my device is supported. Not sure how to proceed. I'm running out of things to try. Anything you can recommend I try?

    Thanks
     
  12. Indy

    Indy Active Member Licensed User

    Hi Erel,

    I've made a discovery. When I use the Tape Recorder app to initialise the bluetooth and then go back to my app, the recording works over the headset. Then when I stop my recording and go back to do another it doesn't work. Again, if I use the other app to initialise the recording works on my app. It's almost like as if the BT isn't being initialised by my app or the streamer object is not being released properly. Would you have any idea/thoughts about this?

    Thanks
     
  13. Erel

    Erel Administrator Staff Member Licensed User

  14. Indy

    Indy Active Member Licensed User

    Hi Erel,

    I found the same bit of code else where and once I added it, it worked perfectly! I can now switch on/off the BT recording at will, which is exactly what I wanted to acheive.

    Thanks for your help.
     
    xulihang and Erel like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice