# Play WAV from the command line



## sam81 (Feb 19, 2017)

I'm looking for programs that play WAV files from the command line. I found `wavplay` already. I'm wondering if there are other programs that can be used to play WAV files, possibly something that is already bundled with OSS.


----------



## scottro (Feb 19, 2017)

ffplay, included with ffmpeg I think, but I could be wrong.  My favorite media player is mpv, which will play wav from the command line as well as most other formats it's given.


----------



## Phishfry (Feb 19, 2017)

You can build multimedia/mplayer from ports without the GUI for command line usage.(X11-OFF)


----------



## aragats (Feb 19, 2017)

+1 for multimedia/mplayer (or multimedia/mplayer2), I use mplayer for almost everything.
Also it's good to have audio/sox, if you don't want to mess with its command line arguments, the symlink /usr/local/bin/play->sox plays right away.


----------



## Deleted member 48958 (Feb 19, 2017)

Try audio/moc, nice command line audio player with playlist support (also it can play in background!).






To enable WAV support, you need to build it from source





Also it can be customized (themes, settings, etc) via configuration file:
`cp /usr/local/share/doc/moc/config.example ~/.moc/config`


----------



## Phishfry (Feb 19, 2017)

I tried out mplayer2 and it plays WAV's from the command line with standard `pkg install mplayer2`, so that works out.

I don't think the base sound system has an audio player.


----------



## Deleted member 9563 (Feb 19, 2017)

I'm a fan of ALSA so would use `aplay file.wav`.


----------



## morbit (Feb 19, 2017)

ILUXA said:


> To enable WAV support, you need to build it from source (...)



Look again, it's WavPack (*.wv), it's a BSD licensed lossless audio compression format. Which I can recommend by the way.


----------



## Deleted member 48958 (Feb 19, 2017)

morbit said:


> Look again, it's WavPack (*.wv), it's a BSD licensed lossless audio compression format. Which I can recommend by the way.


Yes, you're right. To enable "WAV" support in audio/moc, "FFMPEG" option should be enabled with `# make config`, and optionally "WAVPACK", and not vice versa.


----------



## nickednamed (Feb 19, 2017)

I've successfully used all of the following for WAV files:
multimedia/mpv
multimedia/mplayer
multimedia/mplayer2
multimedia/vlc
audio/cmus
audio/moc

But you may need to check the default compile-time options, and re-compile from ports if necessary. You can check the default compile time options before you install with `pkg roptions pkgname`.


----------



## sam81 (Feb 19, 2017)

Thanks to everybody for the suggestions! I've tried several and many fit the bill perfectly. I've been unable to make aplay work, it exits with the following error:

```
Assertion failed: (err >= 0), function set_params, file aplay.c, line 1353.
Aborted by signal Abort trap..
```
there is a note of the same error here: https://www.freshports.org/audio/alsa-utils/


----------

