Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 43

Thread: How to make your laptop play sounds on lid open/close :)

  1. #11
    nikoPSK is offline I Ubuntu, Therefore, I Am
    Join Date
    Sep 2007
    Location
    Victoria, BC
    Beans
    2,265
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to make your laptop play sounds on lid open/close :)

    I like that. I wish I had a camcorder....

  2. #12
    Join Date
    Feb 2007
    Location
    perdita
    Beans
    1,622
    Distro
    Ubuntu

    Re: How to make your laptop play sounds on lid open/close :)

    You can also use espeak or festival to synthetize voice.

  3. #13
    nikoPSK is offline I Ubuntu, Therefore, I Am
    Join Date
    Sep 2007
    Location
    Victoria, BC
    Beans
    2,265
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to make your laptop play sounds on lid open/close :)

    heard of espeak but what's festival?

  4. #14
    Join Date
    Oct 2005
    Location
    London
    Beans
    305

    Re: How to make your laptop play sounds on lid open/close :)

    festival "Hello"
    makes your computer say 'hello'.

    Would do this but I already have an huge reputation as a nerd and it could get annoying in lectures

  5. #15
    nikoPSK is offline I Ubuntu, Therefore, I Am
    Join Date
    Sep 2007
    Location
    Victoria, BC
    Beans
    2,265
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to make your laptop play sounds on lid open/close :)

    ...

    Code:
    niko@home:~$ festival "hello"
    
    WARNING
    No default voice found in ("/usr/share/festival/voices/")
    either no voices unpacked or voice-path is wrong
    Scheme interpreter will work, but there is no voice to speak with.
    WARNING
    
    SIOD ERROR: could not open file hello
    niko@home:~$

  6. #16
    Join Date
    Nov 2007
    Location
    WV
    Beans
    63
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: How to make your laptop play sounds on lid open/close :)

    It works on lid close for me, but not open. I'm new to Ubuntu and Linux in general, but not to programming, so is there a way for me to see what value is returned when lid state is open? More curiosity than anything. Thanks for the idea though. I found all kinds of files in that directory to play with.

  7. #17
    Join Date
    Feb 2007
    Location
    perdita
    Beans
    1,622
    Distro
    Ubuntu

    Re: How to make your laptop play sounds on lid open/close :)

    Just read the contents of the file "/proc/acpi/button/lid/LID/state":
    Code:
    cat /proc/acpi/button/lid/LID/state
    I don't know why it doesn't work on lid open for you though. :/

    @nikoPSK and simplyw00x:
    Code:
    espeak "hello"
    works, but for festival, the syntax is different:
    From the man page:
    --tts Synthesize text in files as speech no files means read from stdin (implies no interaction by default)
    So you can use:
    Code:
    echo "hello" | festival --tts
    or:
    Code:
    festival --tts speak.txt
    where "speak.txt" is a text file containing the text you wish to hear. (very practical )

  8. #18
    Join Date
    Nov 2007
    Location
    WV
    Beans
    63
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: How to make your laptop play sounds on lid open/close :)

    Quote Originally Posted by KIAaze View Post
    Just read the contents of the file "/proc/acpi/button/lid/LID/state":
    Code:
    cat /proc/acpi/button/lid/LID/state
    I don't know why it doesn't work on lid open for you though. :/
    The state seems to show correctly. I have seen posts throughout the forum where laptop lid detection for suspend/hibernate doesn't always work for certain laptops. Mine probably doesn't throw the event (is that what it's called in Linuxspeak?) when the lid opens for some reason, or I need to delay the sound from playing long enough for the screen to re-illuminate. Something to play with in my spare time. The close by itself is still fun. I let my coworker shut the lid. When the computer asked him "Hey! Who turned out the lights?", he was quite startled. There is also fun to be had with power.sh...

  9. #19
    Join Date
    Mar 2005
    Location
    Bloomington, Indiana
    Beans
    225
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: How to make your laptop play sounds on lid open/close :)

    does anyone know how i can make this work when i plug a usb device in?

  10. #20
    Join Date
    Jul 2007
    Location
    Bariloche, Argentina
    Beans
    2,140
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: How to make your laptop play sounds on lid open/close :)

    HEY!
    I just got some voices from Red Alert 2 to use as my system sounds! It's so cool!
    When I close the lid, I hear Sophia saying "On hold", and when I open it, a conscript says: "Good to see you, Sir. What are our orders?". As I was with this, I also put the "Low power" message for when my laptop's battery gets to 10%.
    I love it! Thanks for the idea!

Page 2 of 5 FirstFirst 1234 ... 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
  •