Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Simple command to play audio file for Xfce Timer

  1. #1
    Join Date
    Nov 2006
    Location
    47.45°N 123.1°W Elev. 0
    Beans
    Hidden!
    Distro
    Xubuntu 16.04 Xenial Xerus

    Simple command to play audio file for Xfce Timer

    Hello,

    I'd like to set Xfce4 Timer to play a particular audio file (in Parole) at a certain time. This requires a command line; the file is at /home/mn/Music/Coyote.wav. Can someone please tell me how to write this command?

    I have a feeling I'd find this syntax(?) useful for a lot of other purposes (shortcuts? launchers?) as well.

    Thanks in advance.
    Dell Optiplex GX745
    Intel Core 2 Duo 6400 2.13 Ghz
    2GB RAM
    Linux User 498777 - Ubuntu User 29378

  2. #2
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,050
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Simple command to play audio file for Xfce Timer

    Code:
    aplay /home/mn/Music/Coyote.wav
    I can think of at least 5 other ways to do this. Your challenge is to come up with the others.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  3. #3
    Join Date
    Nov 2006
    Location
    47.45°N 123.1°W Elev. 0
    Beans
    Hidden!
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: Simple command to play audio file for Xfce Timer

    'Ludicrous Speed' is right--thanks for the quick response. As for the challenge, well--although I've been using Ubuntu (now Xubuntu) exclusively--and a lot--for quite a few years, I've never actually written a line of code (except for a bit of HTML years ago on a job) and wouldn't know where or how to begin. I've always used the command line when possible (mainly copying and pasting) but basically I'm a GUI user.

    I've noticed before that there's a kind of disconnect between coders and non-coders. The former sometimes seem to me to take it for granted that all users do or should know how to write code and in an ideal world maybe we all would. But I don't.

    Thanks a million for your line, though--works great (but you knew that).
    Dell Optiplex GX745
    Intel Core 2 Duo 6400 2.13 Ghz
    2GB RAM
    Linux User 498777 - Ubuntu User 29378

  4. #4
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,050
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Simple command to play audio file for Xfce Timer

    I thought the primary reason to use linux was that you could bend it. Otherwise we are all non-thinking zombies blindly clicking at web links saying: "Oooh Shiny I have to have that."

    Code:
    mplayer /home/mn/Music/Coyote.wav
    Come on there are a few more.
    Last edited by tgalati4; February 26th, 2014 at 07:19 AM.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  5. #5
    Join Date
    Dec 2006
    Beans
    7,306

    Re: Simple command to play audio file for Xfce Timer

    No. 3

    sox has a nice utility called play:


    Code:
    andrew@ilium~/shared/luckynight$ play luckynight.wav 
    
    luckynight.wav:
    
     File Size: 10.7M     Bit Rate: 1.41M
      Encoding: Signed PCM    
      Channels: 2 @ 16-bit   
    Samplerate: 44100Hz      
    Replaygain: off         
      Duration: 00:01:00.48  
    
    In:100%  00:01:00.48 [00:00:00.00] Out:2.90M [      |      ] Hd:0.4 Clip:0    
    Done.
    No. 4

    although the same effect can be had by using sox with the -d option:

    Code:
    andrew@ilium~/shared/luckynight$ sox luckynight.wav -d
    
    luckynight.wav:
    
     File Size: 10.7M     Bit Rate: 1.41M
      Encoding: Signed PCM    
      Channels: 2 @ 16-bit   
    Samplerate: 44100Hz      
    Replaygain: off         
      Duration: 00:01:00.48  
    
    In:100%  00:01:00.48 [00:00:00.00] Out:2.90M [      |      ] Hd:0.4 Clip:0    
    Done.
    I believe that makes a total of 4 simple commandlines to play a wav file . Many more to come...
    Last edited by andrew.46; March 1st, 2014 at 08:40 AM. Reason: Added in the numbers :)
    You think that's air you're breathing now?

  6. #6
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,050
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Simple command to play audio file for Xfce Timer

    Number 5:
    Code:
    avplay -nodisp -autoexit -nostats login.wav
    Number 6: You can play a sound through DBUS, but I haven't figured out the syntax yet:

    https://developer.gnome.org/notification-spec/
    Last edited by tgalati4; March 1st, 2014 at 06:20 AM.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  7. #7
    Join Date
    Dec 2006
    Beans
    7,306

    Re: Simple command to play audio file for Xfce Timer

    No. 7

    Among many other faces vlc has a purely commandline interface:

    Code:
    andrew@ilium~/shared/luckynight$ cvlc luckynight.wav 
    VLC media player 2.1.3 Rincewind (revision 2.1.3-0-ge6a71cc)
    [0x20b4ac8] dummy interface: using the dummy interface module...
    [0x1ff7678] main playlist: end of playlist, exiting
    No. 8

    Audacious has a 'headless' option:

    Code:
    audacious --headless --quit-after-play luckynight.wav
    I have a few more in mind but I don't want to hog the spotlight
    You think that's air you're breathing now?

  8. #8
    Join Date
    Jun 2007
    Beans
    12,274

    Re: Simple command to play audio file for Xfce Timer

    play a particular audio file (in Parole) at a certain time
    Is it just me, or did everyone in this question (including OP) ignore the "in Parole" part?
    What would happen if your hard disk died right now?

  9. #9
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,050
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Simple command to play audio file for Xfce Timer

    I ignored it because installing it would pull in a lot of XFCE4 libraries, so I presumed it was an XFCE-specific application.

    Code:
    man parole
    might provide some clues. We are just providing different options.

    So anyone run parole and how do you play a file?
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  10. #10
    Join Date
    Jun 2007
    Beans
    12,274

    Re: Simple command to play audio file for Xfce Timer

    I think it's mpris compatible, so you could probably control it from command line like that. I'm still a little hazy on exactly what the OP was trying to do..
    What would happen if your hard disk died right now?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •