logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).

#1 15-07-2015 06:13:35

Anonyme
Invité

commande info tracks cd-audio et lancer morceau

Bonjour,

Je voudrais lancer la lecture d'un cd audio par la commande terminal. Ça je sais faire pour une lecture entière ou d'un seul morceau.
Mais j'aimerais avoir l'info des pistes avant, et choisir de lancer le titre après avoir eu le nom du morceau.

Cette commande existe t-elle ?

#2 19-07-2015 19:26:23

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

Un petit up.
Moi je trouve rien là dessus smile

#3 19-07-2015 19:50:41

captnfab
Admin-Girafe
Lieu : /dev/random
Distrib. : Debian
Noyau : Dur
(G)UI : gui gui, je zuis un doiseau
Inscription : 07-07-2008
Site Web

Re : commande info tracks cd-audio et lancer morceau

Bah, c'est un peu chaud comme question.
Tu sais, les noms des pistes ne sont en général pas inscrits sur le CD. Du coup, le logiciel doit scanner tout le CD, envoyer ses informations à un site genre CDDB, récupérer les résultats, et donner le nom supposé de la piste qui a été trouvé… tu peux essayer ça :

mplayer cddb://numérodepiste --endpos 0



J'sais pas si ça va l'faire smile


captnfab,
Association Debian-Facile, bépo.
TheDoctor: Your wish is my command… But be careful what you wish for.

Hors ligne

#4 19-07-2015 20:37:57

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

J'essaie ta proposition après smile

Là j'aurais CDCD mais je n'ai pas de son mad

#5 19-07-2015 21:01:27

Slyfox
Membre
Distrib. : Linux pop-os
Noyau : Linux 6.2.6-76060206-generic
(G)UI : GNOME
Inscription : 15-12-2013

Re : commande info tracks cd-audio et lancer morceau

Salut,

Selon le man pour la lecture:

mplayer [cdda|cddb]://piste[-piste_de_fin][:vitesse][/périphérique] [options]



essaye pour la piste 1 (par exemple):

mplayer cdda://1



ou

mplayer cddb://1




Pour la suite j'ai un idée mais il faut que je teste...

A+

Dernière modification par Slyfox (19-07-2015 21:03:28)

Hors ligne

#6 19-07-2015 21:08:51

Slyfox
Membre
Distrib. : Linux pop-os
Noyau : Linux 6.2.6-76060206-generic
(G)UI : GNOME
Inscription : 15-12-2013

Re : commande info tracks cd-audio et lancer morceau

Et pour l'identification... mais pas forcément avec le nom des titres... wink

mplayer -identify -ao null -frames 0 cdda://



ou

mplayer -identify -ao null -frames 0 cddb://

Dernière modification par Slyfox (19-07-2015 21:44:27)

Hors ligne

#7 19-07-2015 21:10:07

Slyfox
Membre
Distrib. : Linux pop-os
Noyau : Linux 6.2.6-76060206-generic
(G)UI : GNOME
Inscription : 15-12-2013

Re : commande info tracks cd-audio et lancer morceau

Après tu aimerais un script ???

Edit:

Toi, tu lance comment la lecture ?

Dernière modification par Slyfox (19-07-2015 21:43:25)

Hors ligne

#8 19-07-2015 21:45:50

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

Salut Slyfox

J'étais en train de voir ce captnfab proposait et je n'ai pas vu tes posts.
Donc problème chez moi, je n'ai ni mplayer ou mplayer2.
J'explique : J'ai mpv et une version svn de smplayer (pour la prise en charge de mpv)
Si j'installe mplayer2 des dépôts, il va me virer les 3 paquets smplayer smplayer-themes et language.

mpv devrait avoir les mêmes options mais c'est pas sûr.

Un script serait très bien.
J'ai toujours regretté le fameux Gnome-CD de l'époque. Je cherche un truc simple pour lire un simple CD-audio et qui face que ça.
Kscd est bien mais voilà pas de KDE chez moi...

Dernière modification par Anonyme (19-07-2015 21:47:17)

#9 19-07-2015 21:51:10

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

Le truc tout con
dans ton terminal
tu scannes le cd (cddb)
il t'affiches 1 - 2 - 3 ... ( avec les titres).
tu fais play le numéro et c'est parti en lecture.


Ou par un script....

Dernière modification par Anonyme (19-07-2015 21:51:59)

#10 19-07-2015 21:53:11

Slyfox
Membre
Distrib. : Linux pop-os
Noyau : Linux 6.2.6-76060206-generic
(G)UI : GNOME
Inscription : 15-12-2013

Re : commande info tracks cd-audio et lancer morceau

Ok pour le script on doit pouvoir faire quelque chose... wink

Sinon mes commandes fonctionne chez toi ?

En passant une autre... qui ressemble à celle de captnfab mais la sienne ne fonctionne pas chez moi (?)

mplayer cddb:// -ao null -frames 0

Dernière modification par Slyfox (19-07-2015 21:55:27)

Hors ligne

#11 19-07-2015 21:59:49

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

Cette dernière


patrick@debian:~$ mplayer cddb:// -ao null -frames 0
MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team
Cannot open file '/home/patrick/.mplayer/input.conf': No such file or directory
Failed to open /home/patrick/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf.

Playing cddb://.
No cache found.
Request[http://freedb.freedb.org/~cddb/cddb.cgi?cmd=stat&hello=anonymous+localhost+MPlayer 2.0-728-g2c378c7-4+b1&proto=1]
Resolving freedb.freedb.org for AF_INET6...
Couldn't resolve name for AF_INET6: freedb.freedb.org
Resolving freedb.freedb.org for AF_INET...
Connecting to server freedb.freedb.org[195.214.216.38]: 80...
body=[500 Command syntax error: incorrect arg count forhandshake.
]
unhandled code
Failed to get the protocol level.
Found audio CD with 19 tracks.
Detected file format: rawaudio

Track 1
Selected audio codec: Uncompressed PCM [pcm]
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
AO: [null] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...


Exiting... (End of file)
patrick@debian:~$

 

#12 19-07-2015 21:59:56

Slyfox
Membre
Distrib. : Linux pop-os
Noyau : Linux 6.2.6-76060206-generic
(G)UI : GNOME
Inscription : 15-12-2013

Re : commande info tracks cd-audio et lancer morceau

Euh, j'étais entrais de te répondre au moment que tu postais... le script t'intéresses toujours ???

Sinon tu peux mettre la ligne de commande pour :

Anonyme a écrit :

Le truc tout con
dans ton terminal
tu scannes le cd (cddb)
il t'affiches 1 - 2 - 3 ... ( avec les titres).
tu fais play le numéro et c'est parti en lecture.

Dernière modification par Slyfox (19-07-2015 22:00:19)

Hors ligne

#13 19-07-2015 22:01:32

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

Post 6


patrick@debian:~/Bureau$ mplayer -identify -ao null -frames 0 cdda://
MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team
Cannot open file '/home/patrick/.mplayer/input.conf': No such file or directory
Failed to open /home/patrick/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf.

Playing cdda://.
ID_CDDA_TRACKS=19
ID_CDDA_TRACK_1_MSF=03:52:15
ID_CDDA_TRACK_2_MSF=04:02:17
ID_CDDA_TRACK_3_MSF=04:04:35
ID_CDDA_TRACK_4_MSF=03:33:38
ID_CDDA_TRACK_5_MSF=04:34:25
ID_CDDA_TRACK_6_MSF=04:14:20
ID_CDDA_TRACK_7_MSF=04:44:05
ID_CDDA_TRACK_8_MSF=04:55:40
ID_CDDA_TRACK_9_MSF=03:08:25
ID_CDDA_TRACK_10_MSF=03:21:32
ID_CDDA_TRACK_11_MSF=05:26:20
ID_CDDA_TRACK_12_MSF=04:13:48
ID_CDDA_TRACK_13_MSF=04:22:35
ID_CDDA_TRACK_14_MSF=04:48:60
ID_CDDA_TRACK_15_MSF=03:15:20
ID_CDDA_TRACK_16_MSF=03:58:02
ID_CDDA_TRACK_17_MSF=04:00:00
ID_CDDA_TRACK_18_MSF=03:51:38
ID_CDDA_TRACK_19_MSF=02:42:72
Found audio CD with 19 tracks.
Detected file format: rawaudio
ID_AUDIO_ID=0
ID_FILENAME=cdda://
ID_DEMUXER=rawaudio
ID_AUDIO_FORMAT=1
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2

Track 1
ID_CDDA_TRACK=1
ID_START_TIME=0.00
ID_LENGTH=0.00
ID_SEEKABLE=1
ID_CHAPTERS=0
Selected audio codec: Uncompressed PCM [pcm]
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
ID_AUDIO_BITRATE=1411200
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
AO: [null] 44100Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=pcm
Video: no video
Starting playback...


Exiting... (End of file)
ID_EXIT=EOF
patrick@debian:~/Bureau$

 







patrick@debian:~/Bureau$ mplayer -identify -ao null -frames 0 cddb://
MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team
Cannot open file '/home/patrick/.mplayer/input.conf': No such file or directory
Failed to open /home/patrick/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf.

Playing cddb://.
ID_CDDA_TRACKS=19
ID_CDDA_TRACK_1_MSF=03:52:15
ID_CDDA_TRACK_2_MSF=04:02:17
ID_CDDA_TRACK_3_MSF=04:04:35
ID_CDDA_TRACK_4_MSF=03:33:38
ID_CDDA_TRACK_5_MSF=04:34:25
ID_CDDA_TRACK_6_MSF=04:14:20
ID_CDDA_TRACK_7_MSF=04:44:05
ID_CDDA_TRACK_8_MSF=04:55:40
ID_CDDA_TRACK_9_MSF=03:08:25
ID_CDDA_TRACK_10_MSF=03:21:32
ID_CDDA_TRACK_11_MSF=05:26:20
ID_CDDA_TRACK_12_MSF=04:13:48
ID_CDDA_TRACK_13_MSF=04:22:35
ID_CDDA_TRACK_14_MSF=04:48:60
ID_CDDA_TRACK_15_MSF=03:15:20
ID_CDDA_TRACK_16_MSF=03:58:02
ID_CDDA_TRACK_17_MSF=04:00:00
ID_CDDA_TRACK_18_MSF=03:51:38
ID_CDDA_TRACK_19_MSF=02:42:72
ID_CDDB_DISCID=19121513
No cache found.
Request[http://freedb.freedb.org/~cddb/cddb.cgi?cmd=stat&hello=anonymous+localhost+MPlayer 2.0-728-g2c378c7-4+b1&proto=1]
Resolving freedb.freedb.org for AF_INET6...
Couldn't resolve name for AF_INET6: freedb.freedb.org
Resolving freedb.freedb.org for AF_INET...
Connecting to server freedb.freedb.org[195.214.216.38]: 80...
body=[500 Command syntax error: incorrect arg count forhandshake.
]
unhandled code
Failed to get the protocol level.
Found audio CD with 19 tracks.
Detected file format: rawaudio
ID_AUDIO_ID=0
ID_FILENAME=cddb://
ID_DEMUXER=rawaudio
ID_AUDIO_FORMAT=1
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2

Track 1
ID_CDDA_TRACK=1
ID_START_TIME=0.00
ID_LENGTH=0.00
ID_SEEKABLE=1
ID_CHAPTERS=0
Selected audio codec: Uncompressed PCM [pcm]
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
ID_AUDIO_BITRATE=1411200
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
AO: [null] 44100Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=pcm
Video: no video
Starting playback...


Exiting... (End of file)
ID_EXIT=EOF
patrick@debian:~/Bureau$

 

#14 19-07-2015 22:02:25

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

Slyfox a écrit :

Euh, j'étais entrais de te répondre au moment que tu postais... le script t'intéresses toujours ???



Mais oui wink

#15 20-07-2015 05:39:16

paskal
autobahn
Lieu : ailleurs
Inscription : 14-06-2011
Site Web

Re : commande info tracks cd-audio et lancer morceau

Pour les CD-Text, ça semble possible : http://unix.stackexchange.com/questions … n-from-cds

I'd love to change the world
But I don't know what to do
So I'll leave it up to you...

logo-sur-fond.png

Hors ligne

#16 20-07-2015 09:43:38

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

J'ai trouvé ça aussi : (en mettant sr0)
C'est dans le style que je cherche.

http://inx.maincontent.net/cdmp


#!/bin/bash
# Script: Copyleft GNU General Public Licence Version 3             Peter Garrett <peter-garrett@ubuntu.com>
# Contributions: David Symons                                       David Symons <david.symons@liberatedcomputing.net>
# set -vex # debug mode
# set -e   # exit on error
# CD Menu and control for mplayer to play audio CDs in terminal. Also uses "abcde" and "cdtool", plus "setcd"

# Foreground colours

white ()   { printf "\E[37m" ; }
yellow ()  { printf "\E[33m" ; }
bold ()    { printf "\E[1m"  ; }

# Background colours

bblack ()   { printf "\E[40m" ; }
bgreen ()   { printf "\E[42m" ; }

cleanup ()
{  
        setterm -cursor on 2>> $DEBUG       # Give $USER the cursor back ;-)
        tput sgr0 ; clear    
        if [ -e /tmp/fifo ] ; then rm /tmp/fifo ; fi      
        if [ -x $(which setcd) ] ; then setcd -x 0 1>> $DEBUG ; fi
        if [ -d $TMPDIR ] ; then rm -rf $TMPDIR ; fi
        kill_both 2>> $DEBUG
        echo -e "\n "$NAME": Error/Debug output is in $DEBUG \n"
        exit 0
}

make_playlist ()
{                                                      # Massage the cddb info a bit...    
    head -2 $TMPDIR/cddb > $TMPDIR/playlist            # Add headings and clobber existing contents.
   
    for each in $LIST
    do
        grep ^${each}: $TMPDIR/cddb | sort -nu >> $TMPDIR/playlist
    done
   
    COUNTER=0                                          # There's probably a better way to do this...
    for counter in $LIST
    do
        COUNTER=$(( $COUNTER + 1 ))
        echo $COUNTER >> $TMPDIR/counter
    done
             
    for tracknumber in $LIST
    do
        echo $tracknumber >> $TMPDIR/sequence
    done
    paste -d, $TMPDIR/counter $TMPDIR/sequence > $TMPDIR/index
   
    END=$(tail -1 $TMPDIR/counter)
    rm $TMPDIR/counter $TMPDIR/sequence
    echo 1 > $TMPDIR/current                           # New playlist always starts at INDEX=1
}

cddb ()
{
    # Get cddb data etc.
    echo -e "\v\v\tPerforming CDDB audio disc information check, please wait... "    
    ABCDE_DIRECTORY=$(abcde -N -d $DEVICE -a cddb | tail -1 | cut -d" " -f4 | sed 's/.$//')
    egrep -v "(Retrieving|^I|^Multiple)" ${ABCDE_DIRECTORY}/cddbchoices \
    | sort -nu | tee $TMPDIR/playlist > $TMPDIR/cddb   # Clean up the mess made by multiples, like classing
                                                       # Edith Piaf as "classical" (huh?) and "something-equally-silly"
    NUMBER_OF_CDDB_LINES=$(wc -l < $TMPDIR/cddb)
    NUMBER_OF_TRACKS=$(( $NUMBER_OF_CDDB_LINES - 1 ))  # This assumes that some genius didn't add extra lines...
    NUMERICAL_LIST=$(seq 1 $NUMBER_OF_TRACKS)
    LIST=$NUMERICAL_LIST  
                                                       
    cp $TMPDIR/cddb $TMPDIR/holdcddb                   # "holdcddb" is a "holding tank" for unedited cddb.
    head -1 $TMPDIR/holdcddb > $TMPDIR/cddb
    echo " " >> $TMPDIR/cddb                           # Make a blank line between heading and playlist...
    tail -$NUMBER_OF_TRACKS $TMPDIR/holdcddb >> $TMPDIR/cddb
    rm $TMPDIR/holdcddb
   
    make_playlist
}

line_erase () { printf "\r" ; tput el ; printf "\r" ; } # Erases current output line without making a new line.

                                                        # The "uniq" and "head" get rid of duplicates from cddb.
track_title () { printf "$(grep ^$(cat $TMPDIR/track): $TMPDIR/playlist | uniq | head -1)" ; }

replay ()
{      
    (
        INDEX=$(cat $TMPDIR/current)
        for tracks in $(seq $INDEX $END)
        do
            TRACK=$(grep ^"${INDEX}," $TMPDIR/index | cut -d, -f2)
      echo $TRACK > $TMPDIR/track          
            run_mplayer
      INDEX=$(( $INDEX + 1 ))
      echo $INDEX > $TMPDIR/current
        done

    ) & replaypid=$!           # This runs in a subshell, so we use $TMPDIR/* to store track and index.
}
   
run_mplayer ()
{
    line_erase
    track_title
    # These mplayer settings may not be ideal for your system. Fiddle with cache and speed 'ad lib'.                    
    mplayer               \
    -really-quiet         \
    -cache 500            \
    -cdda speed=1         \
     cdda://${TRACK}      \
    -slave                \
    -input file=/tmp/fifo \
    -cdrom-device $DEVICE  >> $DEBUG 2>&1  
}

top ()
{
    bblack ; white ; clear ; bold
                                                       # This stuff is positioning, and colour...
    LINE_TO_NAME=58
    LINE_TO_END=$(( $(tput cols) - $LINE_TO_NAME - $NAME_LENGTH ))
    bgreen ; yellow ; printf "%$(tput cols)s" " " | tr ' ' '_'
    bblack ; yellow ; printf "%${LINE_TO_NAME}s" " " | tr ' ' '_'
    white ; printf "$(echo $NAME | tr "[a-z]" "[A-Z]")"
    yellow ; printf "%${LINE_TO_END}s" " " | tr ' ' '_'    
    bblack ; yellow
    printf "\n\n"
                                                       # Print the playlist
    PLAYLIST_LINES=$(wc -l < $TMPDIR/playlist)
    head -$SCROLL $TMPDIR/playlist | tail -$LINES_AVAILABLE
    echo
   
    echo -n -e "\033[s"                                # Cursor's current position is saved by escape sequence
    bold ; bgreen ; white                              # Make a colour block to terminal width, to draw on...
    for colour_block in $(seq 1 5) ; do tput el && printf "\n" ; done
    echo -n -e "\033[u"                                # Restore the cursor to whatever was its previous position
    bold ; bgreen ; white

    echo " *   Volume Up                                            s   Show All Tracks   "
    echo " /   Volume Down          <enter>   Start All             p   Custom Playlist   "
    echo " m   Mute|Unmute          <space>   Pause|Play            r   Range of Tracks   "
    echo " c   Close|Reload CD        +|-     Scroll Playlist       >   Next Track        "
    echo " e   Eject CD                q      Stop and Quit         <   Previous Track    "
 
    bblack ; yellow ; tput el ; printf "\r" ; printf "%$(tput cols)s" " " | tr ' ' '_' ; printf "\n"
    white ; track_title
}

nonsense_check ()  { if [ "$REPLY" = "" ] ; then redraw ; fi ; }

kill_replay ()    
{
    if [ "$replaypid" != "" ] ; then
        kill $replaypid 2>> $DEBUG || true
    fi    
}
                                                                         # Restrict pkill to controlling terminal
kill_both ()       { kill_replay ; pkill -t $(tty | cut -c6-) mplayer 2>> $DEBUG || true ; }
             
redraw ()          { top ; control ; }

redraw_and_play () { top ; replay ; control ; }

list_post_read ()  { setterm -cursor off ; nonsense_check ; kill_both ; }

start_at_1 ()      { kill_both ; LIST=$NUMERICAL_LIST ; make_playlist ; redraw_and_play ; }

control ()
{
    read -s -n 1
    trap cleanup 15 EXIT  # CTRL+C etc.

case $REPLY in
    '*')
    echo "volume +1" > /tmp/fifo
    control
    ;;
    '/')
    echo "volume -1" > /tmp/fifo
    control
    ;;
    ' ')
    echo "pause" > /tmp/fifo &
    control
    ;;
    +|=)
    if [ $SCROLL -eq $PLAYLIST_LINES ] ; then control ; fi
    SCROLL=$(( $SCROLL + 5 ))
    redraw
    ;;
    -|_)
    if [ $SCROLL -eq $LINES_AVAILABLE ] ; then control ; fi
    SCROLL=$(( $SCROLL - 5 ))
    redraw
    ;;
    c|C)
    clear
    CDCHECK=                            # Avoid restarting without a CD
    bold ; yellow ; echo -e "\v\tCD reload... Please wait.........."
    eject -t $DEVICE 2>> $DEBUG || true # Errors if used with non-tray CD ROM - harmless...
    cdcheck
    cddb
    redraw
    ;;  
    e|E)
    kill_both
    LIST=$NUMERICAL_LIST
    clear ; bold ; yellow
    echo -e "\v\tEjecting CD....."
    eject $DEVICE
    echo -e "\n\tPlease remove the CD."
    echo -e "\tThen press \"q\"  to quit "$NAME" ..."
    echo -e "\tOr, insert another CD, then press \"c\".\n"
    control
    redraw
    ;;
    m|M)
    echo "mute" > /tmp/fifo &
    control
    ;;
    q|Q)
    kill_both
    line_erase
    white
    if [ "$(cdinfo -d $DEVICE)" = "no_disc" ] ; then
            eject -t $DEVICE 2>> $DEBUG || true
    else
        printf "\tDo you want to eject the CD? (y/n)"
        read -s -n 1
        if [ "$REPLY" = "y" -o "$REPLY" = "Y" ] ; then
            eject $DEVICE
        fi
    fi
    line_erase
    printf "\tThanks for using ${NAME}!"
    sleep 2
    cleanup
    ;;
    s|S)
    cp $TMPDIR/cddb $TMPDIR/playlist  
    redraw
    ;;
    r|R)
    line_erase
    printf "Type two space-separated start and end track numbers: "
    setterm -cursor on                                 # Visible prompt
    read
    list_post_read
    LIST=$(seq $REPLY)
    make_playlist    
    redraw_and_play
    ;;
    p|P)
    line_erase
    printf "Type a space-separated list of track numbers: "
    setterm -cursor on
    read
    list_post_read
    LIST=$(printf "$REPLY")
    make_playlist  
    redraw_and_play
    ;;
    '.'|'>')
    INDEX=$(cat $TMPDIR/current)
    if [ "$replaypid" = "" ] ; then start_at_1 ; fi
    if [ "$INDEX" != "$END" ] ; then
        echo quit > /tmp/fifo & # Interrupt mplayer in the "replay" loop function --> next track in playlist.
        INDEX=$(( $INDEX + 1 ))
    else
        kill_both
        replay      
    fi
    control
    ;;
    ,|'<')
    INDEX=$(cat $TMPDIR/current)
    if [ "$INDEX" = "" -o "$INDEX" = "1" ] ; then start_at_1 ; fi    
    kill_both
    INDEX=$(( $INDEX - 1 ))
    echo $INDEX > $TMPDIR/current
    replay
    control
    ;;
    *)
    start_at_1
    ;;
esac    
}

cdcheck ()                                             # See if we have anything to play...
{
    for device in $(ls /dev/hd* /dev/scd* 2> /dev/null)
    do                                                 # Check for cdrom group.
        OKGROUP="$(ls -l $device | awk '{print $4}')"
        if [ "$OKGROUP" = "cdrom" ] ; then      
            if [ "$(cdinfo -d $device)" != "data_disc" ] ; then
                if [ "$(cdinfo -d $device)" != "no_disc" ] ; then
                    DEVICE=$device       
                    CDCHECK=OK
                    TMPDIR=$(mktemp -td $NAME.XXXXXXXXXX)
                    for tmp in cddb current index playlist track holdcddb sequence
                      do
                        mktemp $TMPDIR/$tmp 1> /dev/null 2>> $DEBUG
                      done    
                    echo "1" > $TMPDIR/track           # Set initial track  
                fi    
            fi
        fi  
    done
   
    if [ "$CDCHECK" != "OK" ] ; then
        echo -e "\n\tI can't find an audio CD to play... Did you forget something?\n"
        sleep 4
        cleanup
    else
        # Using "setcd" to quieten the drive. Can't see why fast spin is needed for audio CDs.
        if [ -x $(which setcd) ] ; then setcd -x 1 $DEVICE 1>> $DEBUG ; fi        
    fi
}

existing_instance ()                                   # Don't run a new instance if one already exists.
{
        echo -e "\n\tAnother instance of $NAME appears to be running."
        echo -e "\tIf not, please remove /tmp/${NAME}* and /tmp/fifo \n"
        setterm -cursor on
        exit 1
}

    NAME=$(basename $0)
    NAME_LENGTH=$(printf $NAME | wc -m)
    # The cursor gets in the way for input and output fields as used in this script...
    setterm -cursor off
    mkfifo /tmp/fifo || existing_instance              # Control input for mplayer in "slave" mode          
    DEBUG=$(mktemp -t $NAME.debug.XXXXXXXXXX)
                                                       # Warn $USER if terminal is too small
    if [ $(tput cols) -lt 80 ] || [ $(tput lines) -lt 17 ] ; then
        echo -e "\n  $NAME works properly in a terminal *at least* 80x17,"
        echo -e "  or *larger* - sorry... try a bigger terminal!\n"
  sleep 5
        cleanup
    fi
   
    echo -e "  Starting up "$NAME"... CD checks in progress..."
    sleep 1

    # Terminal size - set the initial value for scrolling and track as well...
    LINES_AVAILABLE=$(( $(tput lines) - 12 ))
    SCROLL=$LINES_AVAILABLE
    rm -rf /tmp/$NAME.* 2>> $DEBUG || true             # Stop accumulation of output.
    bblack ; bold ; yellow
    clear
    mkdir -p $HOME/cddb-$NAME
    cd $HOME/cddb-$NAME    # Make abcde dump its stuff in one place instead of spraying it all over $HOME

    cdcheck    
    cddb
    redraw

 

#17 20-07-2015 10:35:18

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

C'est tout bon, c'est résolu smile


apt-get install cdcd
 



Trouver un cordon pour relier physiquement le lecteur de CD à la carte son !!!
( Quel C..)



patrick@debian:~/Bureau$ cdcd -h
Usage: cdcd [options] [commands]
Options:
  -h, --help           display this help and exit
  -v, --version        output version information and exit
  -d, --device=DEVICE  use DEVICE instead of /dev/cdrom
Commands: close, device, ext, ff, getvol, info, list, next, open, pause, play, prev, refresh, resume, rew, rndplay,
setvol, slot, status, stop, toggle, tracks, and verbose.
patrick@debian:~/Bureau$ cdcd
cdcd 0.6.6
Copyright (C) 1998, 1999 Tony Arcieri.
Copyright (C) 2001, 2002, 2003 Fabrice Bauzac.
cdcd is free software, covered by the GNU General Public Licence, and you are welcome to change it and/or distribute
copies of it under certain conditions.  There is absolutely no warranty for cdcd.  See the file COPYING for details.
Using libcdaudio 0.99.12p2.
Enter ? for help.
cdcd> info
Trying CDDB server http://freedb.freedb.org:80/~cddb/cddb.cgi
Connection established.
Retrieving information on 9e08320b.
Match for 9e08320b: A / C / Rock Or Bust
Downloading data...
Album name:     Rock Or Bust
Album artist:   AC/DC
Total tracks:   11      Disc length:    35:00
Stopped
cdcd> tracks
Album name:     Rock Or Bust
Album artist:   AC/DC
Total tracks:   11      Disc length:    35:00

Track   Length      Title
-----------------------------------------------------------------------------------------------------------------------
 1:   > [ 3:03.04]  Rock Or Bust
 2:     [ 2:47.10]  Play Ball
 3:     [ 3:24.28]  Rock The Blues Away
 4:     [ 2:57.19]  Miss Adventure
 5:     [ 3:35.33]  Dogs Of War
 6:     [ 3:22.44]  Got Some Rock & Roll Thunder
 7:     [ 2:44.17]  Hard Times
 8:     [ 3:30.15]  Baptism By Fire
 9:     [ 2:42.63]  Rock The House
10:     [ 3:09.54]  Sweet Candy
11:     [ 3:41.27]  Emission Control
cdcd> play 8
cdcd>

 



Un script avec CDCD serait extra wink

EDIT: C'est vrai que faire un petit script utilisant CDCD avec une petite interface (ex zenity au autres) serait pas mal. Une simple interface à la kscd ou gnome-cd de l'époque.
Il ne ferait que ça.

L'interface se lance.
On voit les pistes du CD avec les titres de l'album.
On double-clic sur un des titres, la lecture part.
Avec de simple boutons  next, play, stop etc ...

Je ne veux pas m'avancer mais ce simple programme n'existe pas mis à part sous kde, à moins que je me trompe.

Dernière modification par Anonyme (20-07-2015 11:33:29)

#18 21-07-2015 15:28:00

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

Le seul player de CD-audio que j'ai trouvé mais abandonné (2004) est Apolos. La compilation des sources se fait aisément mais l'interface en GTK2 passe assez mal avec le moteur de thème actuel.

Un autre qui irait un peu dans ce sens est Deadbeef. Un player vraiment sobre mais pas dans les dépôts. Une version DEB existe pour Debian.

#19 21-07-2015 21:30:36

Slyfox
Membre
Distrib. : Linux pop-os
Noyau : Linux 6.2.6-76060206-generic
(G)UI : GNOME
Inscription : 15-12-2013

Re : commande info tracks cd-audio et lancer morceau

Salut,

J'ai retrouver le soft que j'utiliser avant VLC, il s'appelle Audacious.
Regarde ce lien : https://doc.ubuntu-fr.org/audacious
Il a l'aire relativement épurer... et en plus on peu rajouter des skins.

Pour l'installer:


apt-get update
apt-get install audacious



Si ça marche pas, il faut peut-être rajouter le dépôt deb-multimedia (Debian version Stable)

nano /etc/apt/sources.list



Pour debian version Stable

# stable deb-multimedia
deb http://www.deb-multimedia.org stable main non-free



Enregistres et quitte (Ctrl+o et O)

Puis

apt-get install debian-keyring && gpg --keyring /usr/share/keyrings/debian-keyring.gpg -a --export 07DC563D1F41B907 |apt-key add -
apt-get update
apt-get install audacious

Dernière modification par Slyfox (21-07-2015 21:47:15)

Hors ligne

#20 21-07-2015 21:53:11

Slyfox
Membre
Distrib. : Linux pop-os
Noyau : Linux 6.2.6-76060206-generic
(G)UI : GNOME
Inscription : 15-12-2013

Re : commande info tracks cd-audio et lancer morceau

J'oubliai...

Pour le "diminuer".

Fichier --> Paramètres --> Apparences --> Greffons interface --> Interface Winamp Classic



Et encore plus petit...

Suite à la manip ci-dessus, clique sur la "flèche" à côté de la croix de fermeture.

Dernière modification par Slyfox (21-07-2015 21:54:50)

Hors ligne

#21 22-07-2015 04:54:28

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

Merci Slyfox.
Oui, je connais Audacioux (Bon lecteur)

Mon choix pour l'instant se porte sur cdcd


apt-get install cdcd libcdaudio
 



J'ouvre un terminal et tape la commande :


cdcd
 




patrick@debian:~$ cdcd
cdcd 0.6.6
Copyright (C) 1998, 1999 Tony Arcieri.
Copyright (C) 2001, 2002, 2003 Fabrice Bauzac.
cdcd is free software, covered by the GNU General Public Licence, and you are welcome to change it and/or distribute
copies of it under certain conditions.  There is absolutely no warranty for cdcd.  See the file COPYING for details.
Using libcdaudio 0.99.12p2.
Enter ? for help.
cdcd> ?
Commands: !, ?, access, close, debug, device, edit, eject, exit, ext, ff, getvol, help, info, list, next, open, pause,
play, prev, quit, refresh, resume, rew, rndplay, setvol, sites, slot, status, stop, toggle, tracks, and verbose.
For more specific help, type `help <command>'.
cdcd> tracks
Album name:     Rock Or Bust
Album artist:   AC/DC
Total tracks:   11      Disc length:    35:00

Track   Length      Title
-----------------------------------------------------------------------------------------------------------------------
 1:     [ 3:03.04]  Rock Or Bust
 2:     [ 2:47.10]  Play Ball
 3:     [ 3:24.28]  Rock The Blues Away
 4:     [ 2:57.19]  Miss Adventure
 5:   > [ 3:35.33]  Dogs Of War
 6:     [ 3:22.44]  Got Some Rock & Roll Thunder
 7:     [ 2:44.17]  Hard Times
 8:     [ 3:30.15]  Baptism By Fire
 9:     [ 2:42.63]  Rock The House
10:     [ 3:09.54]  Sweet Candy
11:     [ 3:41.27]  Emission Control
cdcd> play 2
cdcd>

...
 



Trouver un cordon pour relier physiquement le lecteur de CD à la carte son 

Dernière modification par Anonyme (22-07-2015 04:56:35)

#22 22-07-2015 20:19:29

Slyfox
Membre
Distrib. : Linux pop-os
Noyau : Linux 6.2.6-76060206-generic
(G)UI : GNOME
Inscription : 15-12-2013

Re : commande info tracks cd-audio et lancer morceau

Anonyme a écrit :

C'est vrai que faire un petit script utilisant CDCD avec une petite interface (ex zenity au autres) serait pas mal. Une simple interface à la kscd ou gnome-cd de l'époque.
Il ne ferait que ça.

L'interface se lance.
On voit les pistes du CD avec les titres de l'album.
On double-clic sur un des titres, la lecture part.
Avec de simple boutons  next, play, stop etc ...

Je ne veux pas m'avancer mais ce simple programme n'existe pas mis à part sous kde, à moins que je me trompe.



Si je fais un script pour cdcd il faudra être patient je suis pas mal occupé et en plus les vacances approchent. cool

Après je n'arrive pas à utiliser cdcd, il est bien installé mais je n'ai pas accès au menu des titres ? Peut-être c'est que je n'ai pas mis le bon chemin (/dev/sr0).

Hors ligne

#23 22-07-2015 20:25:37

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

Ok, je serais patient wink

#24 22-07-2015 20:27:35

Slyfox
Membre
Distrib. : Linux pop-os
Noyau : Linux 6.2.6-76060206-generic
(G)UI : GNOME
Inscription : 15-12-2013

Re : commande info tracks cd-audio et lancer morceau

Le chemin doit bien être /dev/sr0 car si je tape "info"

il me retourne:

slyfox@pb-debian:~$ cdcd
cdcd 0.6.6
Copyright (C) 1998, 1999 Tony Arcieri.
Copyright (C) 2001, 2002, 2003 Fabrice Bauzac.
cdcd is free software, covered by the GNU General Public Licence, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for cdcd.  See the file COPYING for details.
Using libcdaudio 0.99.12p2.
Enter ? for help.
cdcd> info
Album name:     Zest Of (CD1)
Album artist:   Zazie
Total tracks:   19      Disc paused:    00:00 of 75:56
Paused:         (CD1) 00 00:00 of 00:00
cdcd>



Mais je n'arrive pas à lire le CD ! roll

Peut-être que je devrais essayer avec un CD d' AC/DC ?  cool tongue

Dernière modification par Slyfox (22-07-2015 20:32:54)

Hors ligne

#25 22-07-2015 20:32:31

Anonyme
Invité

Re : commande info tracks cd-audio et lancer morceau

Et

cdcd> tracks

Et ensuite

cdcd> play 2

Dernière modification par Anonyme (22-07-2015 20:33:55)

Pied de page des forums