如何在 Ubuntu 中录制流媒体音频
录音
![](/data/attachment/album/202212/25/154829ol11lp47i8o6222c.jpg)



> 
> 如何在 Ubuntu 和其他 Linux 发行版中录制音频？
> 
> 
> 


如果你想通过计算机的麦克风录制语音，可以使用 GNOME <ruby> 录音机 <rt>  Sound Recorder </rt></ruby> 或 Audacity。


使用 GNOME 录音机很简单，但它功能不足。Audacity 最初可能会让人无从入手，但它有很多专业级录音的功能。不过，在本教程中，我不打算详细讨论这个问题。


GNOME 录音机能与麦克风配合使用。还有一个叫做 Audio recorder 的工具，除了麦克风输入，你可以使用它来录制流媒体音乐（来自 Sptify、YouTube、互联网广播、Skype 和其他大多数来源）。


总而言之，我将向你展示以下步骤：


* 使用 GNOME 录音机录制声音
* 使用 Audio Recorder 录制流音频


### 使用 GNOME 录音机从麦克风录制音频


GNOME 桌面环境有很多有用的应用程序，录音机就是其中之一。


你可以从 Ubuntu 软件中心安装 [录音机](https://wiki.gnome.org/Apps/SoundRecorder)。


![Sound Recorder can be installed from the Ubuntu Software Center](/data/attachment/album/202212/25/154841ku4ggolyogi7guur.png)


或者，你可以在终端中使用此命令来安装它：



```
sudo apt install gnome-sound-recorder

```

安装后，你可以在系统菜单中找到它，并从那里启动它。


![GNOME Sound Recorder](/data/attachment/album/202212/25/154841lqs48hgq4sblhs8s.png)


在开始使用它之前，应确保在系统设置中选择了正确的输入源：


![Ensure that you have chosen correct input in system settings](/data/attachment/album/202212/25/154841tzfuvgr589vj0uzo.png)


打开录音机，它将显示如下界面：


![Hit the Record button to start audio recording](/data/attachment/album/202212/25/154842exxfxkwvwhee5xgs.png)


点击“<ruby> 录制 <rt>  Record </rt></ruby>”按钮，它立即开始录制音频。录制时，你可以选择暂停、停止或取消录制。


![Options while recording audio](/data/attachment/album/202212/25/154842l1nk1t7mvgvztevw.png)


你的录音将保存并可从应用程序界面本身获得。单击保存的录音以突出显示。


你可以回放或删除该录音。你可以通过单击“保存/下载”按钮选择将其保存到其他位置。你也可以使用“编辑”按钮重命名该录音。


![Saved recordings](/data/attachment/album/202212/25/154842renjcncnjj5e452o.png)


这很方便，对吧？你可以选择以 `MP3`、`FLAC` 和多种格式录制。


#### 删除 GNOME 录音机


不喜欢它或发现它缺乏功能？


你可以从 Ubuntu 软件中心删除 GNOME 录音机，或使用以下命令：



```
sudo apt remove gnome-sound-recorder

```

GNOME 录音机应用功能有限，它只从麦克风录制，在某些情况下这不是你想要的。


想象一下你想录制 Skype 通话或在应用程序或网络浏览器中播放的内容？在这种情况下，漂亮的 Audio Recorder 会有所帮助。


### 使用 Audio Recorder 来录制流媒体音频


你可以使用 [官方 PPA](https://launchpad.net/~audio-recorder/+archive/ubuntu/ppa) 在 Ubuntu 和 LinuxMint 中安装 `Audio Recorder`。在终端中依次使用以下命令：



```
sudo apt-add-repository ppa:audio-recorder/ppa
sudo apt update
sudo apt install audio-recorder

```

或者，你可以从 [启动台](https://launchpad.net/audio-recorder) 下载源代码。安装后，你可以从“<ruby> 活动概述 <rt>  Activity Overview </rt></ruby>”里启动应用程序：


![Audio Recorder](/data/attachment/album/202212/25/154842mtum14v2vl2vurvv.png)


#### 记录不同来源的各种声音


Audio Recorder 记录计算机产生的各种声音。


它记录通过系统声卡、麦克风、浏览器、网络摄像头等播放的音频。


换句话说，即使你的系统打喷嚏，它也会记录（如果你想记录的话）。它允许你选择录制设备，如网络摄像头、麦克风、Skype 等。


要录制流媒体音乐，请选择适当的源。例如，如果你正在 Rhythmbox 中播放流媒体广播，请选择 Rythmbox。


![Audio-Recorder Audio Settings](/data/attachment/album/202212/25/154843me3eadha3tl872cv.png)


#### 在你方便的时候录制


Audio Recorder 还提供了设置计时器的选项。你可以在给定的时钟时间或预定义的间隔开始、停止或暂停录制。你还可以设置录制文件大小的限制。


此外，你可以在没有音频（或声音很低）时暂停（和停止），并在声音恢复时继续。


你所要做的就是编辑计时器面板中的文本。注释掉你不想应用的“规则”，并根据你的要求编辑这些规则。


![Audio-recorder Timer Settings](/data/attachment/album/202212/25/154843frd8i7u3gi30kfc3.png)


它提供了其他设置，如登录时自动启动、显示托盘图标和其他记录设置。


![Audio-recorder Additional Settings](/data/attachment/album/202212/25/154843dom1na2n8ztom2ng.png)


#### 以各种文件格式保存录制的音乐文件


另一个宝藏。你可以将录制的文件保存为你喜爱的文件格式。支持的文件格式有 OGG 音频、Flac、MP3、SPX 和 WAV。我录音时更喜欢用 MP3 格式。


录制的文件存储在 `~/Audio` 中，即主目录中的“音频”文件夹中。


![Audio-recorder Audio Formats](/data/attachment/album/202212/25/154844a7ogq2g707r9q75q.png)


#### Audio Recorder 有多好？


我在 Ubuntu 中使用 Audio Recorder [录制 YouTube 上播放的音乐](https://itsfoss.com/youtube-dl-audio-only/)。我用 MP3 格式保存了一段 2 分钟的视频，占用了 934 KB 的空间。但我必须说，我没想到录制的音质会这么好。老实说，我无法将它与 YouTube 上的原始歌曲区分开来。


#### 删除 Audio Recorder


如果你不喜欢 Audio Recorder，可以使用以下命令将其删除：



```
sudo apt remove audio-recorder

```

[同时删除 PPA](https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/) 是个好主意：



```
sudo apt-add-repository -r ppa:audio-recorder/ppa

```

### 结论


Linux 中可能还有其他几种用于音频录制的工具。像 GNOME 一样，其他桌面环境也可能有录音应用程序。我知道深度操作系统肯定有一个。


GNOME 录音机是一个不错的工具，用于从麦克风录制声音。对于录制各种来源的声音，Audio Recorder 是一个不错的选择。


我希望这篇文章能满足你的录音需求。如果你有什么建议，请告诉我。




---


via: <https://itsfoss.com/record-streaming-audio/>


作者：[Abhishek Prakash](https://itsfoss.com/) 选题：[lkxed](https://github.com/lkxed) 译者：[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

How to record audio in Ubuntu and other Linux distributions?

If you want to record a voiceover through your computer's microphone, you can use GNOME Sound recorder or Audacity.

Using GNOME Sound Recorder is easy, but it lacks features. Audacity could be overwhelming initially, but it has plenty of features for professional-level recording. However, I am not going into that detail in this tutorial.

GNOME Sound Recorder works with the microphone. There is another tool called Audio Recorder and you can use it to record streaming music (from Spotify, YouTube, internet radio, Skype and most other sources) apart from microphone input.

To summarize, I’ll show you the steps:

- To
**record sound**using GNOME Sound Recorder - To
**record streaming audio**using Audio Recorder

## Using Sound Recorder to record audio from the microphone

GNOME desktop environment has a good variety of useful applications. Sound Recorder is one of them.

You can install the [Sound Recorder](https://wiki.gnome.org/Apps/SoundRecorder?ref=itsfoss.com) from the Ubuntu Software Center.

![sound recorder ubuntu](https://itsfoss.com/content/images/wordpress/2022/08/sound-recorder-ubuntu.png)

Or, you can use this command in the terminal to install it:

`sudo apt install gnome-sound-recorder`


Once installed, you can find it in the system menu and start from there.

![sound recorder](https://itsfoss.com/content/images/wordpress/2022/08/sound-recorder.png)

Before you start using it, you should ensure that you have the correct input source chosen in the system settings. GNOME Sound Recorder

![microphone settings ubuntu](https://itsfoss.com/content/images/wordpress/2022/08/microphone-settings-ubuntu.png)

Once you open the Sound Recorder application, it will show an interface like the one below.

![using sound recorder linux](https://itsfoss.com/content/images/wordpress/2022/08/using-sound-recorder-linux.png)

Hit on the record button and it starts recording audio instantly. While recording, you get options to pause, stop or discord the recording.

![Options while recording audio with GNOME sound recorder in Linux](https://itsfoss.com/content/images/wordpress/2022/08/sound-recording-with-sound-recorder.png)

Your recordings are saved and available from the application interface itself. Click on the saved recordings to highlight it.

You can replay the recordings or delete it. You can choose to save it to another location by clicking the save/download button. You may also rename the recordings using the edit button.

![Using saved audio recording in GNOME Sound Recorder](https://itsfoss.com/content/images/wordpress/2022/08/sound-recorder-interface.png)

That’s quite convenient, right? You can choose to record in MP3, FLAC and a couple of more formats.

### Removing GNOME Sound Recorder

Don’t like it or find it lacking in terms of features?

You can remove GNOME Sound Recorder from the Ubuntu Software Center or use the following command:

`sudo apt remove gnome-sound-recorder`


The application of GNOME Sound recorder is limited. It only records from the microphone and this is not what you would want in certain situations.

Imagin you want to record a Skype call or something which is playing in an application or web browser? The nifty Audio Recorder helps in such cases.

## Using Audio Recorder to record streaming audio

You can watch this video to see how to use Audio Recorder. It’s a bit old but the steps are the same.

You can use the [official PPA](https://launchpad.net/~audio-recorder/+archive/ubuntu/ppa?ref=itsfoss.com) to install Audio Recorder in Ubuntu and Linux Mint. Use the following commands in the terminal (Ctrl+Alt+T) one by one:

```
sudo apt-add-repository ppa:audio-recorder/ppa
sudo apt update
sudo apt install audio-recorder
```


Alternatively, you can download the source code from [launchpad](https://launchpad.net/audio-recorder?ref=itsfoss.com). Once installed, you can start the application from the Activity Overview:

![audio recorder in overview](https://itsfoss.com/content/images/wordpress/2022/08/audio-recorder-in-overview.png)

### Record all kinds of sound from various sources

Audio Recorder records all kinds of sounds your computer makes.

It records audio played through your system’s soundcard, microphones, browsers, webcams and more.

In other words, it records even if your system sneezes (given that you want to record it). It allows you to select the recording device such as webcam, microphone, Skype, etc.

To record the streaming music, select the appropriate source. For example, if you are playing streaming radio in Rhythmbox, then select Rythmbox.

![audio recorder audio settings](https://itsfoss.com/content/images/wordpress/2022/08/audio-recorder-audio-settings.png)

### Record at your convenience

Audio Recorder also gives you the option of setting timer. You can start, stop or pause recording at a given clock time or at a pre-defined interval. You can also set the limit on the recorded file size.

Moreover, you can pause (and stop) when there is no audio (or very low sound) and resume it when sound comes back.

All you have to do is to edit the text in the Timer panel. Comment out the “rules” you don’t want to apply and edit the ones per your requirement.

![audio recorder timer settings](https://itsfoss.com/content/images/wordpress/2022/08/audio-recorder-timer-settings.png)

It provides additional settings like auto start at login, show tray icon and other record settings.

![audio recorder additional settings](https://itsfoss.com/content/images/wordpress/2022/08/audio-recorder-additional-settings.png)

### Save the recorded music file in various file formats

Another gem. You can save the recorded file in your favourite file format. Supported file formats are OGG audio, Flac, MP3, SPX and WAV. I prefer MP3 for my recordings.

The **recorded files are stored in ~/Audio,** i.e., in the Audio folder inside your home directory.

![audio recorder audio formats](https://itsfoss.com/content/images/wordpress/2022/08/audio-recorder-audio-formats.png)

### How good is Audio Recorder?

I used Audio Recorder in Ubuntu to [record the music played on YouTube](https://itsfoss.com/youtube-dl-audio-only/). I saved a 2-minute video in MP3 format that took 934 KB of space. But I must say I was not expecting the recorded sound quality to be so good. Honestly, I could not distinguish it from the original YouTube song.

### Removing Audio Recorder

If you don’t find Audio Recorder to your liking, you can remove it using the following commands:

`sudo apt remove audio-recorder`


It will be a good idea to [remove the PPA as well](https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/):

`sudo apt-add-repository -r ppa:audio-recorder/ppa`


## Conclusion

There are probably several other tools for audio recording in Linux. Like GNOME, other desktop environments may also have sound recording apps. I know Deepin has one for sure.

GNOME Sound Recorder is a decent tool for recording sound from your microphone. For recording sound from various sources, Audio Recorder is a good choice.

I hope it helps with your audio recording needs. Let me know if you have any suggestions.