LinuxCommandLibrary

audtool

Control and query the Audacious music player

TLDR

Play/pause audio playback

$ audtool playback-playpause
copy

Print artist, album, and song name of currently playing song
$ audtool current-song
copy

Set volume of audio playback
$ audtool set-volume [100]
copy

Skip to the next song
$ audtool playlist-advance
copy

Print the bitrate of the current song in kilobits
$ audtool current-song-bitrate-kbps
copy

Open Audacious in full-screen if hidden
$ audtool mainwin-show
copy

Display help
$ audtool help
copy

Display settings
$ audtool preferences-show
copy

SYNOPSIS

audtool [GLOBAL_OPTIONS] COMMAND [ARGUMENTS...]

PARAMETERS

--help
    Displays a help message detailing available commands and options.

--version
    Displays the version information for audtool.

playback-play
    Starts playback of the current song.

playback-pause
    Pauses playback. If paused, resumes playback.

playback-stop
    Stops playback.

playback-next
    Skips to the next song in the playlist.

playback-prev
    Skips to the previous song in the playlist.

playback-seek SECONDS
    Seeks to a specific position (in seconds) within the current song.

playback-status
    Reports the current playback status (e.g., 'playing', 'paused', 'stopped').

current-song-filename
    Outputs the full path and filename of the currently playing song.

current-song-output-length
    Outputs the total length of the current song in seconds.

current-song-tuple-field FIELD
    Outputs a specific metadata field (e.g., 'artist', 'title', 'album') of the current song.

playlist-add FILE...
    Adds one or more music files or directories to the current playlist.

playlist-clear
    Clears all songs from the current playlist.

playlist-length
    Outputs the total number of songs in the current playlist.

playlist-current-pos
    Outputs the 0-indexed position of the currently playing song in the playlist.

volume-get
    Outputs the current volume level as a percentage (0-100).

volume-set PERCENT
    Sets the volume level to the specified percentage (0-100).

shuffle-on
    Enables shuffle mode for playback.

shuffle-off
    Disables shuffle mode for playback.

repeat-on
    Enables repeat mode (repeats current song or playlist).

repeat-off
    Disables repeat mode.

DESCRIPTION

The audtool command is a powerful command-line utility designed to interact with and control the Audacious media player. It allows users to manage playback, manipulate playlists, retrieve song information, and adjust various player settings directly from the terminal or within scripts. This provides a versatile interface for automation, remote control, or simply quick actions without needing to open or interact with the graphical user interface. It is particularly useful for scripting custom keyboard shortcuts, integrating with desktop environments, or building custom media player frontends.

For audtool to function, an instance of the Audacious media player must be running, as it communicates with the active player process.

CAVEATS

audtool requires an instance of the Audacious media player to be running. It cannot start Audacious, nor can it control multiple instances of Audacious simultaneously. Its functionality is limited to controlling the currently active Audacious process.

USAGE EXAMPLES

To play the next song:
audtool playback-next

To add a song to the playlist:
audtool playlist-add ~/Music/mysong.mp3

To get the current song's title:
audtool current-song-tuple-field title

To set volume to 50%:
audtool volume-set 50

HISTORY

audtool is an integral part of the Audacious media player project. Audacious itself originated as a fork of XMMS (X Multimedia System) in 2005, aiming to maintain a classic Winamp-like interface while providing modern audio backend support and features. audtool was developed alongside Audacious to offer a robust command-line interface, extending the player's utility beyond its graphical environment and facilitating integration with various scripting and automation tasks common in Linux desktop environments.

SEE ALSO

audacious(1), mpc(1), cmus-remote(1)

Copied to clipboard