Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: trying to record audio from pulseaudio

  1. #1
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,466
    Distro
    Xubuntu 18.04 Bionic Beaver

    trying to record audio from pulseaudio

    search results here and in search sites (like qwant) have suggested audacity and pavucontrol. the latter is already installed so i tried it. the man page tells very little. running it, i see tabs for Playback, Recording, and Output Devices. shouldn't there also be input devices? Playback show a lot of sources with speech-dispatcher showing up 6 times (why so many?). the one that lets me adjust the volume of the music i am playing from YouTube in Firefox is named "AudioIPC Server: AudioStream". but, Recording just has No application is currently recording audio and shows no applications. is pavucontrol useful to get a recording made? i see that audacity is also already installed so i started it up. it sure looks like a many featured audio editor and even has a record button. but it looks like something that will take some time to learn. is there a quick way (simple tool) to record audio from pulseaudio to a file, preferably in .flac format, but .wav is OK? is there documentation for an API to get the audio in a C or Python program?
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

  2. #2
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,308

    Re: trying to record audio from pulseaudio

    I use Audacity and pavucontrol. Input devices in pavucontrol on my computer are Microphone and Line-in, but those don't apply for recording streaming audio like you are doing. Just the recording tab is used. Nothing shows in the Recording tab unless the recorder (audacity) is actually recording or monitoring. So with audacity, you start monitoring the stream first, set the volume in the recording tab, then when ready to start the actual recording press record in Audacity. See the attached screenshot made when recording some streaming audio.

    To save a recording to a file, you export it from Audacity (File > export) in the desired audio format. (Audacity does not record directly to mp3, flac, or other formats.)

    Usually, you want to do some editing of the Audacity recording first - like normalizing, trimming and so forth before exporting.
    Attached Images Attached Images

  3. #3
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,466
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: trying to record audio from pulseaudio

    does audacity write out the audio file as it records or does it just buffer it in memory? i want to do recordings that run for many hours.
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

  4. #4
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,308

    Re: trying to record audio from pulseaudio

    It writes to disk. When recording, it indicates at the bottom of the Audacity window how much recording time you have left for your disk space.

  5. #5
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,466
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: trying to record audio from pulseaudio

    i'm lost on this. i have some audio playing in another userid. pulseaudio is running in system mode so i continue to hear the same audio when i switch userids in lightdm (dm-tool switch-to-user <username>). i have both pavucontrol and audacity started in one virtual desktop with very little there. i run Xfce with panel plugins that include a volume control that spans users (probably because of PA's system mode).

    i don't understand what to do first, second, and so on. how can i know when i have the volume set right? do i set it in pavucontrol or in audacity? what file will it write out and what format? i assume it can read that format back in.
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

  6. #6
    Join Date
    Dec 2006
    Beans
    7,319

    Re: trying to record audio from pulseaudio

    Some wise words here that may help you out...
    You think that's air you're breathing now?

  7. #7
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,308

    Re: trying to record audio from pulseaudio

    The volume control on panel doesn't affect recording level in Audacity - it only affects the speaker output on the computer. You must set Audacity recording level in pulseaudio's recording tab while monotoring the audio stream in audacity. The recording level is reflected in the Recording Meter in Audacity while monitoring and recording.

    A few comments and concerns: Audacity has a little recording level slider on the toolbar (also a slider for output level), but those don't seem to work. The playback meter doesn't work on mine when playing back the recording in Audacity. I set record level at 100% or up to maximum level in pavucontrol when recording a TED talk, but even that seems a bit weak with streaming audio - peaks should be closer to 0 db. If the maximum recording level you can get still seems too low on playback in Audacity, try Effect > Amplify after making the recording. I would like a higher possible input level, but I don't know of a way to boost the recording level outside of pulseaudio. The scale of the recording amplitude graph created while recording is too small for me. Click on the y-axis at 0.00 and it will zoom in.

    (See post #16 for updates to these comments)

    Audacity Manual
    https://manual.audacityteam.org/index.html
    Audacity Toolbars
    https://manual.audacityteam.org/man/..._overview.html
    Last edited by Dennis N; August 11th, 2019 at 05:34 PM. Reason: edit: maximum level in Ubuntu > maximum level in pavucontrol

  8. #8
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,308

    Re: trying to record audio from pulseaudio

    I found that Xubuntu (18.04) has another volume adjustment that affects Audacity's recording level. The little microphone slider in the regular volume control popup gives a boost to whatever input level pavucontrol has set. See the attachment. With this, you can adjust the Audacity peak recording level close to 0.00 as it should be possible to do. Ubuntu using the same source is peaking at about -9.00 db setting the pavucontrol recording level at the max. Not high enough.
    Attached Images Attached Images
    Last edited by Dennis N; August 6th, 2019 at 04:56 PM.

  9. #9
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,466
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: trying to record audio from pulseaudio

    i did read something in what i had googled about this that hinted to me that the recording is happening through the sound card analog feedback layer, i.e. it goes through the D/A, then through a volume control or two, then through A/D. i'd rather stay digital all the way, such as creating a new playback device that saves to a file or loops back to where some process can pick up that digital stream.
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

  10. #10
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,308

    Re: trying to record audio from pulseaudio

    Solutions to Gnome recording levels. After some poking about, I found how to increase the recording input volume in Gnome Desktop. There is now a setting in puavucontrol Playback Tab for AudioIPC Server. It's not shown unless you are monitoring or recording. Setting this, together with ALSA plugin level in Recording Tab, allow boosting the input to an acceptable level. Even Settings > Sound in Gnome also has adjustment of this in its Applications tab, but there is no readout of the % setting as there is in pavucontrol. Both of these utilities are manipulating the same sound settings, just different GUIs.

    (See post #16 for updates to these comments)
    Last edited by Dennis N; August 11th, 2019 at 05:35 PM.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •