Skip to content

Latest commit

 

History

History
90 lines (70 loc) · 1.68 KB

default_import_script.md

File metadata and controls

90 lines (70 loc) · 1.68 KB
layout title
default
Default xwax Import Script

xwax 1.6 - Current

This version supports Debian and Ubuntu systems which have avconv instead of ffmpeg.

#!/bin/sh
#
# Audio import handler for xwax
#
# This script takes an output sample rate and filename as arguments,
# and outputs signed, little-endian, 16-bit, 2 channel audio on
# standard output. Errors to standard error.
#
# You can adjust this script yourself to customise the support for
# different file formats and codecs.
#

FILE="$1"
RATE="$2"

case "$FILE" in

*.cdaudio)
	echo "Calling CD extract..." >&2
	exec cdparanoia -r `cat "$FILE"` -
	;;

*.mp3)
	echo "Calling MP3 decoder..." >&2
	exec mpg123 -q -s --rate "$RATE" --stereo "$FILE"
	;;

*)
	echo "Calling fallback decoder..." >&2

	FFMPEG=$(which ffmpeg 2> /dev/null || which avconv 2> /dev/null)

	if [ -z "$FFMPEG" ]; then
		echo "$0: no ffmpeg or avconv available to decode file" >&2
		exit 1
	fi

	exec "$FFMPEG" -v 0 -i "$FILE" -f s16le -ar "$RATE" -
	;;

esac

xwax 1.5

#!/bin/sh
#
# Audio import handler for xwax
#
# This script takes an output sample rate and filename as arguments,
# and outputs signed, little-endian, 16-bit, 2 channel audio on
# standard output. Errors to standard error.
#
# You can adjust this script yourself to customise the support for
# different file formats and codecs.
#

FILE="$1"
RATE="$2"

case "$FILE" in

*.cdaudio)
    echo "Calling CD extract..." >&2
    exec cdparanoia -r `cat "$FILE"` -
    ;;

*.mp3)
    echo "Calling MP3 decoder..." >&2
    exec mpg123 -q -s --rate "$RATE" --stereo "$FILE"
    ;;

*)
    echo "Calling fallback decoder..." >&2
    exec ffmpeg -v 0 -i "$FILE" -f s16le -ar "$RATE" -
    ;;

esac