在 FreeDOS 中聆听音乐
FreeDOS 音乐

> 
> Mplayer 是 Linux、Windows、Mac 和 DOS 等操作系统上常见的一款开源媒体播放器。
> 
> 
> 


![](/data/attachment/album/202205/17/092828vffyeliiz33hqf31.jpg "Woman programming")


听音乐是放松心情的好方法。在 Linux 上，我使用 Rhythmbox 听音乐。但是你可能不知道在 FreeDOS 上也可以听音乐。让我们看一下两款流行的音乐播放器吧：


### 用 Mplayer 听音乐


[Mplayer](https://en.wikipedia.org/wiki/MPlayer) 是一款开源的媒体播放器，通常安装于 Linux、Windows 和 Mac 上，但也有 DOS 版本可用。这里我们讨论的就是在 FreeDOS 版本。虽然其 DOS 移植版基于旧版（2007 年的 1.0rc2-3-3-2 版），但它完全适用于在 DOS 上播放媒体。


我使用 MPlayer 在 FreeDOS 上听音乐文件。在这个例子中，我复制了我最喜欢的有声读物之一，[Big Finish Productions](https://bigfinish.com/) 的<ruby> 神秘博士：闪点行动 <rt>  Doctor Who: Flashpoint </rt></ruby>，并在我的 FreeDOS 计算机上将其保存为 `C:\MUSIC\FLASHPNT.MP3`。为了在 FreeDOS 上收听闪点行动，我从 FreeDOS 命令行启动 MPlayer 并指定要播放的 MP3 文件名。MPlayer 的基本用法是 `mplayer [options] filename`，如果默认设置可用，你应该可以直接使用该文件名启动 MPlayer。在本例中，我运行以下命令将工作目录切换为 `\MUSIC`，然后使用 MPlayer 播放我的 MP3 有声读物文件：



```
CD \MUSIC
MPLAYER FLASHPNT.MP3

```

FreeDOS *不区分大小写*，因此它将忽略 DOS 命令和任何文件或目录的大小写字母的区别。你键入 `cd \music` 或 `Cd \Music` 都可以切换到 Music 目录，效果相同。


![FreeDOS 上的 Mplayer](/data/attachment/album/202205/17/092831yvsxsl2xanz424kk.png "You can use Mplayer to listen to MP3 files")


*你可以用 Mplayer 播放 MP3 文件*


使用 MPlayer 在 FreeDOS 播放音乐文件时没有花哨的界面。但同时，它也不会分散注意力。所以我可以一边让 FreeDOS 在我的 DOS 计算机上播放 MP3 文件，一边使用另一台计算机做其他事情。然而，FreeDOS 一次只运行一个任务（换句话说，DOS 是一个<ruby> 单任务 <rt>  single-tasking </rt></ruby>操作系统），所以我不能将 MPlayer 置于 FreeDOS 的“后台”运行，而在 *同一台 FreeDOS 机* 上处理其他事情。


请注意，MPlayer 是一个需要大量内存才能运行的大程序。虽然 DOS 本身并不需要太多的内存来运行，但我建议至少有 16M 的内存来运行 MPlayer。


### 使用 Open Cubic Player 听音频文件


FreeDOS 不止提供了 MPlayer 来播放媒体。还有 [Open Cubic Player](https://www.cubic.org/player/)，它支持多种文件格式，包括 Midi 和 WAV 文件。


1999 年，我录制了一段简短的音频文件，内容是我说：“你好，我是 Jim Hall，我把 ‘FreeDOS’ 发音为 *FreeDOS*。"这是一个玩笑，借鉴了 Linus Torvalds 录制的演示他如何发音 Linux 的 [类似的音频文件](https://commons.wikimedia.org/wiki/File:Linus-linux.ogg)（`English.au`，包含在 1994 年的 Linux 源代码树中）中的创意。我们不会在 FreeDOS 中分发这段 FreeDOS 音频剪辑，但欢迎你从我们的 [Silly Sounds](https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/util/sillysounds/) 目录中下载它，该目录位于 [Ibiblio](https://www.ibiblio.org/) 的 FreeDOS 文件存档中。


你可以使用 Open Cubic Player 收听 *FreeDOS* 音频剪辑。通常从 `\APPS\OPENCP` 目录键入 `CP` 命令运行 Open Cubic Player。但 Open Cubic Player 是 32 位应用程序，运行它需要 32 位 DOS 扩展器。常见的 DOS 扩展器是 DOS/4GW。虽然可以免费使用，但 DOS/4GW 不是开源程序，因此我们不会将其作为 FreeDOS 包分发。


相反，FreeDOS 提供了另一个名为 DOS/32A 的开源32位扩展器。如果你在安装 FreeDOS 时没有安装所有内容，则可能需要使用 [FDIMPLES](https://opensource.com/article/21/6/freedos-package-manager) 进行安装。我使用这两行命令切换到 `\APPS\OPENCP` 路径，并使用 DOS/32A 扩展器运行 Open Cubic Player：



```
CD \APPS\OPENCP
DOS32A CP

```

Open Cubic Player 没有花哨的用户界面，但你可以使用方向键将 <ruby> 文件选择器 <rt>  File Selector </rt></ruby> 导航到包含要播放的媒体文件的目录。


![Open Cubic Player](/data/attachment/album/202205/17/092831lfzg246bb7tjbd2g.png "Open Cubic Player opens with a file selector")


*Open Cubic Player 打开文件选择器*


文本比在其他 DOS 应用程序中显示的要小，因为 Open Cubic Player 会自动将显示更改为使用 50 行文本，而不是通常的 25 行。当你退出程序时，Open Cubic Player 会将显示重置为 25 行。


选择媒体文件后，Open Cubic Player 将循环播放该文件（按键盘上的 `Esc` 键退出）。当文件通过扬声器播放时，Open Cubic Player 会显示一个频谱仪，以便你可以观察左右声道的音频。FreeDOS 音频剪辑是以单声道录制的，因此左右声道是相同的。


![Open Cubic Player](/data/attachment/album/202205/17/092832pw2hoyi999h7r7ix.png "Open Cubic Player playing the \"FreeDOS\" audio clip")


*Open Cubic Player 中播放 FreeDOS 音频文件*


DOS 可能来自较早的年代，但这并不意味着你不能使用 FreeDOS 来执行现代任务或播放当前的媒体。如果你喜欢听数字音乐，试一试在 FreeDOS上 使用 Open Cubic Player 或 MPlayer 吧！


（题图由 [Anselmo Pedraz](https://pixabay.com/zh/users/ansfoto-7261652/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=6824489) 在 [Pixabay](https://pixabay.com/zh/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=6824489) 上发布）




---


via: <https://opensource.com/article/21/6/listen-music-freedos>


作者：[Jim Hall](https://opensource.com/users/jim-hall) 选题：[lujun9972](https://github.com/lujun9972) 译者：[hanszhao80](https://github.com/hanszhao80) 校对：[wxy](https://github.com/wxy)


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


OK
Music is a great way to relax. On Linux, I listen to music using Rhythmbox. But did you know you can listen to music on FreeDOS, as well? Let's take a look at two popular programs to listen to music:

## Listen to music with Mplayer

[Mplayer](https://en.wikipedia.org/wiki/MPlayer) is an open source media player that's usually found on Linux, Windows, and Mac—but there's a DOS version available, too. And that's the version we include in FreeDOS. While the DOS port is based on an older version (version 1.0rc2-3-3-2 from 2007) it is perfectly serviceable for playing media on DOS.


I use Mplayer to listen to music files on FreeDOS. For this example, I've copied one of my favorite audiobooks, Doctor Who: Flashpoint by [Big Finish Productions](https://bigfinish.com/), and saved it as `C:\MUSIC\FLASHPNT.MP3`

on my FreeDOS computer. To listen to Flashpoint on FreeDOS, I launch Mplayer from the FreeDOS command line and specify the MP3 filename to play. The basic usage of Mplayer is `mplayer [options] filename`

so if the default settings work well for you, then you can just launch Mplayer with the filename. In this case, I ran these commands to change my working directory to `\MUSIC`

and then run Mplayer with my MP3 audiobook file:

```
CD \MUSIC
MPLAYER FLASHPNT.MP3
```


FreeDOS is *case insensitive*, so it will accept uppercase or lowercase letters for DOS commands and any files or directories. You could also type `cd \music`

or `Cd \Music`

to move into the Music directory, and that would work the same.

![You can use Mplayer to listen to MP3 files mplayer on FreeDOS](https://opensource.com/sites/default/files/uploads/mplayer.png)

You can use Mplayer to listen to MP3 files

(Jim Hall, [CC-BY SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/))

Using Mplayer is a "no frills" way to listen to music files on FreeDOS. But at the same time, it's not distracting, so I can leave FreeDOS to play the MP3 file on my DOS computer while I use my other computer to do something else. However, FreeDOS runs tasks one at a time (in other words, DOS is a "single-tasking" operating system) so I cannot run Mplayer in the "background" on FreeDOS while I work on something else *on the same FreeDOS computer*.

Note that Mplayer is a big program that requires a lot of memory to run. While DOS itself doesn't require much RAM to operate, I recommend at least 16 megabytes of memory to run Mplayer.

## Listen to audio files with Open Cubic Player

FreeDOS offers more than just Mplayer for playing media. We also include the [Open Cubic Player](https://www.cubic.org/player/), which supports a variety of file formats including Midi and WAV files.

In 1999, I recorded a short audio file of me saying, "Hello, this is Jim Hall, and I pronounce 'FreeDOS' as *FreeDOS*." This was meant as a joke, riffing off of a [similar audio file](https://commons.wikimedia.org/wiki/File:Linus-linux.ogg) (`english.au`

, included in the Linux source code tree in 1994) recorded by Linus Torvalds to demonstrate how he pronounces "Linux." We don't distribute the *FreeDOS* audio clip in FreeDOS itself, but you are welcome to download it from our [Silly Sounds](https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/util/sillysounds/) directory, found in the FreeDOS files archive at [Ibiblio](https://www.ibiblio.org/).

You can listen to the *FreeDOS* audio clip using the Open Cubic Player. To run Open Cubic Player, you normally would run `CP`

from the `\APPS\OPENCP`

directory. However, Open Cubic Player is a 32-bit application that requires a 32-bit DOS extender. A common DOS extender is DOS/4GW. While free to use, DOS/4GW is not an open source program, so we do not distribute it as a FreeDOS package.

Instead, FreeDOS provides another open source 32-bit extender called DOS/32A. If you did not install everything when you installed FreeDOS, you may need to install it using [FDIMPLES](https://opensource.com/article/21/6/freedos-package-manager). I used these two commands to move into the `\APPS\OPENCP`

directory, and to run Open Cubic Player using the DOS/32A extender:

```
CD \APPS\OPENCP
DOS32A CP
```


Open Cubic Player doesn't sport a fancy user interface, but you can use the arrow keys to navigate the *File Selector* to the directory that contains the media file you want to play.

![Open Cubic Player opens with a file selector Open Cubic Player](https://opensource.com/sites/default/files/uploads/opencp1.png)

Open Cubic Player opens with a file selector

(Jim Hall, [CC-BY SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/))

The text appears smaller than in other DOS applications because Open Cubic Player automatically changes the display to use 50 lines of text, instead of the usual 25 lines. Open Cubic Player will reset the display back to 25 lines when you exit the program.

When you have selected your media file, Open Cubic Player will play it in a loop. (Press the Esc key on your keyboard to quit.) As the file plays over the speakers, Open Cubic Player displays a spectrum analyzer so you can see the audio for the left and right channels. The *FreeDOS* audio clip is recorded in mono, so the left and right channels are the same.

![Open Cubic Player playing the "FreeDOS" audio clip Open Cubic Player](https://opensource.com/sites/default/files/uploads/opencp2.png)

Open Cubic Player playing the "FreeDOS" audio clip

(Jim Hall, [CC-BY SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/))

DOS may be from an older era, but that doesn't mean you can't use FreeDOS to run modern tasks or play current media. If you like to listen to digital music, try using Open Cubic Player or Mplayer on FreeDOS.

## Comments are closed.