Csound Csound-dev Csound-tekno Search About

Re: aiff player

Date1998-12-16 04:19
FromTobiah
SubjectRe: aiff player
> Hello,
> I would like to know if somebody know a good aiff player that run under
> linux for x86.

Here is a really whacky script that I made once.  It needs Csound, and 'sndinfo'
which comes with csound.

#Start Script#
rm -f /tmp/*.orc /tmp/*.sco

for each in $@; do

        CHANNELS=`sndinfo $each | grep srate | cut -f3 -d" " | cut -c1`
        SRATE=`sndinfo $each | grep srate | cut -f2 -d" " | tr -d ','`

        if  test $CHANNELS = m; then
                echo "  sr = $SRATE"                     > /tmp/$$.orc
                echo "  kr = $SRATE"                    >> /tmp/$$.orc
                echo "  ksmps = 1"                      >> /tmp/$$.orc
                echo "  nchnls = 1"                     >> /tmp/$$.orc
                echo ""                                 >> /tmp/$$.orc
                echo "  instr 1"                        >> /tmp/$$.orc
                echo "          asig    in"             >> /tmp/$$.orc
                echo "                  out     asig"   >> /tmp/$$.orc
                echo "  endin"                          >> /tmp/$$.orc

                echo "Playing : Speed $SRATE Hz Mono ..."

        fi

        if  test $CHANNELS = s; then
                echo "  sr = $SRATE"                             > /tmp/$$.orc
                echo "  kr = $SRATE"                            >> /tmp/$$.orc
                echo "  ksmps = 1"                              >> /tmp/$$.orc
                echo "  nchnls = 2"                             >> /tmp/$$.orc
                echo ""                                         >> /tmp/$$.orc
                echo "  instr 1"                                >> /tmp/$$.orc
                echo "          asigl, asigr    ins"            >> /tmp/$$.orc
                echo "                  outs    asigl, asigr"   >> /tmp/$$.orc
                echo "  endin"                                  >> /tmp/$$.orc

                echo "Playing : Speed $SRATE Hz Stereo ..."
        fi

        echo "i1 0 `sndinfo $each | grep seconds | cut  -d' ' -f 7`" > /tmp/$$.sco

        csound -W -d -i $each -odac /tmp/$$.orc /tmp/$$.sco >/dev/null 2>/dev/null

        rm /tmp/$$.orc /tmp/$$.sco score.srt