comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: How to run a GNAT program without starting a terminal session
Date: Thu, 19 Jul 2018 11:25:45 -0400
Date: 2018-07-19T11:25:45-04:00	[thread overview]
Message-ID: <cn91ldppmkvqch2i94fl1u9eievvabrtb9@4ax.com> (raw)
In-Reply-To: ac4e0071-3a6d-47ad-a9bb-2f7ca36620fc@googlegroups.com

On Wed, 18 Jul 2018 23:59:47 -0700 (PDT), Jerry <list_email@icloud.com>
declaimed the following:


>However, my "Beep" function uses Character'val(7), the ASCII bell--macOS normally interprets this to play the default system sound which for some reason is not making it to my speakers when run from Automator/Applescript but does work when run from terminal. But I have a function called Execute_Shell() which binds to the ?C command like this: pragma Import(C, system). Then if I put
>

	If your Beep() is relying upon the \a ("alert")

>>> ord("\a")
7
>>> 

CHARACTER, then the function must be sending it to some I/O stream.
Typically it is the console (stdout), and producing a sound is the
responsibility of the console when it SEES the \a byte.

	If you run the program in some form that redirects stdout to a
bit-bucket or file (or to a text window that does NOT interpret ASCII
control codes) then nothing will trigger to play a sound -- it is just a
non-printable character..

>say hello
>
>as the command string for Execute_Shell and drop it into the Automator workflow as described in your link, it _does_ work correctly. Applescript probably gets the same result.

	What does "work correctly" mean here? {after a short bit of Google} Do
you mean the text shows up in a log window? Log windows likely do not
interpret most control codes (probably nothing beyond <new-line>). Or is
"say" a voice synthesizer? If so, it is the "say" command itself that is
driving the speakers.


https://stackoverflow.com/questions/7408785/is-there-a-way-to-play-a-system-beep-on-mac-os
{Note that pretty much all examples are "command line" -- ie;
console/terminal -- programs; nothing that does not have an attached
console}

https://stackoverflow.com/questions/3127977/how-to-make-the-hardware-beep-sound-in-mac-os-x-10-6
{Closest answer here is the response to use "afplay" with a sound file;
everything else is, again, console/terminal}



-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/ 


  reply	other threads:[~2018-07-19 15:25 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17  1:20 How to run a GNAT program without starting a terminal session Jerry
2018-07-17  4:35 ` Jerry
2018-07-17  9:55 ` AdaMagica
2018-07-17 10:08   ` Jerry
2018-07-17 10:23     ` Jerry
2018-07-17 13:13     ` Dennis Lee Bieber
2018-07-17 12:46 ` Björn Lundin
2018-07-17 16:20   ` Jeffrey R. Carter
2018-07-17 21:10     ` Jerry
2018-07-18  6:27       ` Jeffrey R. Carter
2018-07-19  1:41         ` Jerry
2018-07-19  2:31           ` Dennis Lee Bieber
2018-07-17 21:07   ` Jerry
2018-07-17 21:12     ` Shark8
2018-07-17 21:56       ` Jerry
2018-07-18  1:33         ` Shark8
2018-07-18  7:37       ` Björn Lundin
2018-07-18 16:41         ` Shark8
2018-07-18 21:18         ` Jeffrey R. Carter
2018-07-19  6:59           ` Jerry
2018-07-19 15:25             ` Dennis Lee Bieber [this message]
2018-07-19 16:50             ` Jeffrey R. Carter
2018-07-19 20:47               ` Jerry
2018-07-19  1:47         ` Jerry
2018-07-17 18:21 ` Shark8
2018-07-17 20:53   ` Jerry
2018-07-18 16:34     ` Shark8
2018-07-18 20:30       ` Björn Lundin
2018-07-18 21:09         ` Dan'l Miller
2018-07-18 21:41           ` Bill Findlay
2018-07-19  2:13             ` Dan'l Miller
2018-07-19  2:40           ` Jerry
2018-07-19  3:19             ` Dan'l Miller
2018-07-19  2:57 ` Jerry
2018-07-19  7:20   ` Björn Lundin
2018-07-19 11:30     ` Jerry
2018-07-19 16:40       ` Björn Lundin
2018-07-19 20:46         ` Jerry
2018-07-20  7:32           ` Björn Lundin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox