Hi all,

I have a USB C headset.

I am setting it up, so it’s plugged into my Linux box, so it can listen to music, and make calls, etc from my phone, via bluetooth.

Then I don’t have to keep unplugging my headset and plugging it into my phone.

Also so I can record directly to the Linux machine, that is broadcast from my phone.

But, how can I intercept the Bluetooth audio, and record it?

Thank you.

  • Cris@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    1
    ·
    edit-2
    3 months ago

    I don’t totally follow (just woke up) but if I follow what you’re asking, the program “Audacity” is very capable and is worth taking a look at for recording audio from a linux device

    Hope you’re able to find what you need!

    • makingStuffForFun@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      ·
      3 months ago

      Thank you. So I’ll definitely look into something like that. I want to make it scriptable, so that it records drops the files straight into a predefined folder. I guess for me it’s getting my head around the idea that it can record the Bluetooth audio.

      I’ll just start experimenting to see what I can find. Thanks again.

      • Cris@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        3 months ago

        Wait, it’s plugged into the computer, and connected to the phone via Bluetooth, and you want to intercept the bluetooth signal to record the audio to your computer…? Am I understanding right? That kinda negates all of the advice I gave. That’s a super convoluted thing to try and do, and well beyond the scope of basic technical advice 😅

        It seems to me like it’d be easier to record the audio via your phone and automatically send it from your computer, rather than intercept the bluetooth signal, but even that would be complicated if you want to do it automatically

        • makingStuffForFun@lemmy.mlOP
          link
          fedilink
          arrow-up
          1
          ·
          3 months ago

          That’s exactly right, that is what I’m trying to do. :-)

          I’ve almost got at working, I have pulse audio recording the signal that’s coming to me, I guess via the Bluetooth speaker function. So the phone is treating the computer as a Bluetooth speaker.

          However when I talk, it does not record anything from the microphone going back to the phone.

          So my headset is a USBC, with mic an headphones (speakers).

          The signal coming from the phone to my ears can be recorded.

          But when I talk and speak back to the phone through my headset microphone, it does not record.

          This is the command I am currently trying, but I will dig deeper:

          pw-record --volume=1.0 -P '{ stream.capture.sink=true }' /home/userName/Temp/Test.ogg
          
          • Cris@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            3 months ago

            I’m not sure linux noobs is the best place to find the answers you’re looking for, a more technical forum is more likely to have people interested in finding answers to your situation. Regardless, that’s well beyond me unfortunately, I’m not the most technical user 😅

            Good luck! I hope you get it working!

            • makingStuffForFun@lemmy.mlOP
              link
              fedilink
              arrow-up
              1
              ·
              3 months ago

              Thankyou so much, I guess I was hoping there would be some Grand Lord Master of the Bluetooth Linux Audio Channel Recording legend kind of person living here. :-) Stroking their cat, and meditating at the screen whilst levitating in a yoga pose, dispersing waves of confident knowledge into lemmy.

              Maybe that will be me one day :-)

              One can only hope

              • Cris@lemmy.world
                link
                fedilink
                English
                arrow-up
                2
                ·
                3 months ago

                Lol, don’t let your dreams be dreams! I believe in you! And when I need to install pipewire I’ll have someone to ask lmao

                Good luck! I hope you’re able to find your solution ☺️

        • makingStuffForFun@lemmy.mlOP
          link
          fedilink
          Wikang Tagalog
          arrow-up
          1
          ·
          3 months ago

          Just to put things into even more of a spin, I just tested it with a phone call, and now it records my voice through the microphone, but it doesn’t record the speaker’s voice coming back through the speaker.

          I guess on a phone call it’s switched around?

          This Is Going to Be Challenging :-)

          I want to do it all on the computer because I want to run processing over it via an AI, and I want it done local on my machines so that it is private, and nobody has their voice shared with anybody else.

          It’s a bit of an experiment and I just want to see if I can do it. It will greatly speed up my workflow if I can.

      • Cris@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        3 months ago

        If Bluetooth is working properly, you should be able to record bluetooth microphone audio the same way you’d record audio from any mic connected to the computer, wired or wireless. Just make sure you point the recording software to the correct microphone input. Usually the easiest way to do that is to go to the settings of your desktop environment (GNOME, kde, cinnamon) and select the correct microphone (this is assuming you’re using a desktop environment for a graphical desktop). A voice recorder app or website should allow you to test whether the Bluetooth mic is working properly if you’re unsure.

        After that you’ll need something that can record that supports scripting. I can’t help you there, I have no idea if audacity has scripting support, but something probably exists. But anything that can record audio should play nicely with Bluetooth if Bluetooth is working properly on your computer

  • tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 months ago

    You probably have PulseAudio somewhere in your audio chain.

    If you open the pavucontrol program, it’ll show you PulseAudio controls.

    If your mic is enabled, you’ll see it in the “Input Devices” tab. Most audio recording programs will let you choose the source you want to use. One of the devices here will be the “default”, and you can click the checkbox next to it to select that.

    I (very recently) learned from a problematic Sennheiser Momentum 4 that Bluetooth headsets can have two, separate, mutually-exclusive modes, one for high-definition audio, where they act only as headphones, and one where they can act as a combined mic and headphones, but have lower audio quality. I don’t know if that affects your headset as well. However, if it also applies, then your headset might be in “high definition audio” mode, and it won’t have an entry in the “Input Devices” list. Instead, click on the “Configuration” tab, and set the thing to what is for me “HSP/HFP” – this is the lower-quality headset mode. Hopefully then you’ll see an entry in the “Input Devices”.

      • tal@lemmy.today
        link
        fedilink
        English
        arrow-up
        1
        arrow-down
        1
        ·
        3 months ago

        I don’t know off-the-cuff, but I’m pretty sure that most people in 2024 have PulseAudio in their audio stack. They might be using software that has a different interface that’s being routed into PulseAudio. I have apps using PipeWire, PulseAudio, and ALSA APIs, but it’s passing through PulseAudio.

        I actually do occasionally use JACK, which is the main present-day alternative, but not for general system playback. And if you’re the kind of person who is running JACK because you want to absolutely minimize latency in your audio stack for real-time stuff, I’d give reasonable odds that you aren’t putting Bluetooth headphones in that stack, either.

        Other sound servers that I can think of – YIFF, esd, stuff like that – are all ancient.

  • jlow (he/him)@beehaw.org
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    Hmm, I have no idea if that actually works (don’t think I ever recorded audio) but I think every program that can use the mic input as an audio source should be able to do that, I’d try OBS Studio, Audacity (or whatever the cooler fork is called), screen recorders. Maybe someone who has actually done this can chime in 😸

    • makingStuffForFun@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      ·
      3 months ago

      Thank you so much, yes I have tried prtty much everything you have mentioned there.

      If the phone is say playing music or something like that then my computer can record the phone. but it can’t hear me talking into the mic, even though I want it to.

      If I am on a phone call, then I can only record myself, and it can’t record the person speaking.

      Depending on what I am doing, it won’t record the microphone or speaker.

      Of course, I wanted to record both. :-)

      • foggy@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        Blue Moon is for finding, discovering, it connecting Bluetooth devices. So now, that’s not what you would be doing with Bluemon.

        But with it, you would see a lot more information about what’s going on with that Bluetooth connection. Sometimes a Bluetooth device will get found, and connect, but the services that Bluetooth device are running aren’t getting communicated. This is something that Bluemon would help you find