Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch sounds.  (Read 23075 times)

0 Members and 1 Guest are viewing this topic.

Boozu

    Topic Starter


    Hopeful

    Thanked: 9
    • Yes
    • Yes
  • Certifications: List
  • Experience: Familiar
  • OS: Windows 10
Batch sounds.
« on: September 18, 2009, 03:01:29 AM »
I want to make simple beeps and boops in a batch program withought having to call a audio file. Is there any way to do that? I want it so I can output Morse code. Why? Just because it would be cool.
Don't worry about it.  If it's not good at stock, then it's not good.


Two-eyes



    Intermediate
  • Thanked: 4
    Re: Batch sounds.
    « Reply #1 on: September 18, 2009, 03:16:20 AM »
    You can write ECHO followed by ALT+7. (on the number pad).  On my system I can write ^G (control+G), and it does the same thing.

    Code: [Select]
    ECHO ^G
    Two-Eyes %

    EDIT: but that is only one sound...
    Quote
    I believe the bushes in my yard will BURN before God picks up a PC to send a message


    Boozu

      Topic Starter


      Hopeful

      Thanked: 9
      • Yes
      • Yes
    • Certifications: List
    • Experience: Familiar
    • OS: Windows 10
    Re: Batch sounds.
    « Reply #2 on: September 18, 2009, 03:23:23 AM »
    That did absolutely nothing. Anything else?
    Don't worry about it.  If it's not good at stock, then it's not good.


    Two-eyes



      Intermediate
    • Thanked: 4
      Re: Batch sounds.
      « Reply #3 on: September 18, 2009, 03:26:41 AM »
      what did you do exactly?
      Quote
      I believe the bushes in my yard will BURN before God picks up a PC to send a message


      gpl



        Apprentice
      • Thanked: 27
        Re: Batch sounds.
        « Reply #4 on: September 18, 2009, 03:45:38 AM »
        For morse, you would be restricted to dahs only !
        At least in the UK you could spell MOT (and TOM)

        Boozu

          Topic Starter


          Hopeful

          Thanked: 9
          • Yes
          • Yes
        • Certifications: List
        • Experience: Familiar
        • OS: Windows 10
        Re: Batch sounds.
        « Reply #5 on: September 18, 2009, 04:03:21 AM »
        Two-eyes: I did echo "^G" "alt+7" and "•" <The symbol derived from pressing alt and then 7. I got no change at all.

        gpl: If by dahs you mean a short beeps then that is not a big deal. If there is no way to lengthen the duration of the sound then I will do something like this with the beeps.   . . . ... ... ... . . .   Basically putting a distinguishable pause in bitween a single beep and a line of beeps.
        Don't worry about it.  If it's not good at stock, then it's not good.


        Two-eyes



          Intermediate
        • Thanked: 4
          Re: Batch sounds.
          « Reply #6 on: September 18, 2009, 04:10:40 AM »
          I see.  When i press alt+7 it shows "^G".  In your case, it shows that dot.
          Well, i know that 7 is the ascii code for the bell..... I'm sorry, but I don't know why it isn't working for you.  Be sure you press the number pad's 7 (although I bet you did, cos the dot was shown).

          Try control+G and see what happens.

          Two-Eyes %
          Quote
          I believe the bushes in my yard will BURN before God picks up a PC to send a message


          Boozu

            Topic Starter


            Hopeful

            Thanked: 9
            • Yes
            • Yes
          • Certifications: List
          • Experience: Familiar
          • OS: Windows 10
          Re: Batch sounds.
          « Reply #7 on: September 18, 2009, 04:26:21 AM »
          That did not work but on the ascii table (I just learned about this thing this afternoon, haha) under Oct it says 007. I tried that and I immediately heard a ding but it did not put out a symbol in the batch file so I tried alt+007 but nothing happend. So how can I tell the batch file to do the equivalent of alt+007?
          Don't worry about it.  If it's not good at stock, then it's not good.


          Two-eyes



            Intermediate
          • Thanked: 4
            Re: Batch sounds.
            « Reply #8 on: September 18, 2009, 05:04:32 AM »
            Ahhh, I see.  Were you trying in a batch file?  I was trying on the command prompt itself.  When I tried to write alt+7 in a batch file, I couldn't.  Then I tried this:

            Code: [Select]
            c:\>COPY CON bell.bat
            @ECHO off

            ECHO [and here I pressed alt+7, and the ^G symbol appeared]
            [I pressed ctrl+Z and this symbol appeared: ^Z, then I pressed ENTER]

            When I ran the batch file the bell was heard:
            Code: [Select]
            c:\>bell.bat
            [bell was heard]
            c:\>

            When I open the batch file in notepad, after ECHO, there was a symbol that represents a non-printable character (a box.  Can't paste it here >:().

            So what you can do is this:
            1) use COPY CON to insert one "bell"
            2) open the batch file in notepad(or whatever), and whenever you want to output the sound, copy the symbol and paste it

            hope this helped

            Two-Eyes %

            PS. If you didn't understand anything (which i bet you didn't  ;D...cos, sry, but... I'm that way), just tell me, but please don't curse me to heck  ;)
            Quote
            I believe the bushes in my yard will BURN before God picks up a PC to send a message


            Two-eyes



              Intermediate
            • Thanked: 4
              Re: Batch sounds.
              « Reply #9 on: September 18, 2009, 05:09:21 AM »
              I also, just discovered this:

              In the EDIT window, you can press ctrl+p to insert a special character...so you can do this:
              ECHO [control+p] [alt+7].  Unfortunately, you can't do that in notepad :(

              Two-Eyes %
              Quote
              I believe the bushes in my yard will BURN before God picks up a PC to send a message


              Boozu

                Topic Starter


                Hopeful

                Thanked: 9
                • Yes
                • Yes
              • Certifications: List
              • Experience: Familiar
              • OS: Windows 10
              Re: Batch sounds.
              « Reply #10 on: September 18, 2009, 05:33:05 AM »
              Ok. I am totally lost. What do I have to do? The ctrl+z is paste  and ctrl+p is print so what are thous supposed to do? You said something about not being able to do it in notepad and that you did hear something at one point right? So how do I do that? One more question, when you say ^G and ^Z do you literally mean the "^" symbol and the letter "G" and the same for the other or is the combination supposed to mean something?
              Don't worry about it.  If it's not good at stock, then it's not good.


              Two-eyes



                Intermediate
              • Thanked: 4
                Re: Batch sounds.
                « Reply #11 on: September 18, 2009, 05:50:45 AM »
                Ok...very sorry...I need to learn how to communicate.

                Quote
                The ctrl+z is paste  and ctrl+p is print so what are thous supposed to do?
                !!!I was not working in notepad, but in the command prompt!!!

                I gave it this command: COPY CON [filename]
                and then wrote ECHO [alt+7], ENTER
                [ctrl+Z], ENTER
                Quote
                One more question, when you say ^G and ^Z do you literally mean the "^" symbol and the letter "G" and the same for the other or is the combination supposed to mean something?

                no, I didn't mean "^" and "G" but [ctrl+G] and those symbols APPEARED. Same for Z.

                Quote
                What do I have to do?
                So again:
                1) in the command prompt do this:
                Code: [Select]
                C:\>COPY CON bell.bat
                @ECHO off

                ECHO [alt+7]
                [ctrl+Z]

                C:\>bell.bat
                [sound is heard]
                C:\>

                2) THEN you can open bell.bat in notepad, and copy the (NEW) symbol as many times as you want, adding pauses, etc.

                Quote
                You said something about not being able to do it in notepad
                Forget that...it was just an extra note. :)

                Hope that's better,
                Two-Eyes %
                Quote
                I believe the bushes in my yard will BURN before God picks up a PC to send a message


                Boozu

                  Topic Starter


                  Hopeful

                  Thanked: 9
                  • Yes
                  • Yes
                • Certifications: List
                • Experience: Familiar
                • OS: Windows 10
                Re: Batch sounds.
                « Reply #12 on: September 18, 2009, 06:07:02 AM »
                That is so weird. Manually doing the exact same thing does not work. So I copied it many times and it only gave me one beep but then I did this:
                Code: [Select]
                @echo off

                echo 
                echo 
                echo 
                echo 
                pause
                echo 
                echo 
                echo 
                echo 
                echo 
                echo 
                echo 
                echo 
                echo 

                And I got 4 beeps and once a button was pressed I got 1 more beep. Funny. Now I will play with pauses insted of making the person running it press a button. Does that make since? Thanks for the help. Once I get it to a point that I like, I will upload the file for you guys to try.
                Don't worry about it.  If it's not good at stock, then it's not good.


                Two-eyes



                  Intermediate
                • Thanked: 4
                  Re: Batch sounds.
                  « Reply #13 on: September 18, 2009, 06:37:52 AM »
                  It worked for me....  ???

                  Thanks, looking forward for the program, i suggest you use sleep.exe for pauses, but i don't know if it can part-seconds  :-\

                  Two-Eyes %
                  Quote
                  I believe the bushes in my yard will BURN before God picks up a PC to send a message


                  Salmon Trout

                  • Guest
                  Re: Batch sounds.
                  « Reply #14 on: September 18, 2009, 06:49:08 AM »
                  i suggest you use sleep.exe for pauses, but i don't know if it can part-seconds

                  Code: [Select]
                  C:\>sleep /?
                  Usage:  sleep      time-to-sleep-in-seconds
                          sleep [-m] time-to-sleep-in-milliseconds
                          sleep [-c] commited-memory ratio (1%-100%)

                  There are 1000 milliseconds in 1 second.