No BEEP

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
urbaud
Posts: 120
Joined: Tue Feb 24, 2009 12:10 am

No BEEP

Post by urbaud » Tue Dec 07, 2010 2:36 am

I have a strange problem with the Beep command. If I put it into a mouseUp handler, nothing happens. My computer speakers work fine and other system sounds and revSpeak work great. If I use this code nothing happens:

Code: Select all

on mouseUp
beep 4
end mouseUp
I have tried setting all the other beep settings, such as: Duration, loudness, pitch, and sound to see what effect they might have. None of these have any effect. I have also checked my system settings and they are all correct. I'm using an Apple Mac desktop, Intel based machine. I'm using LiveCode v 4.5.1, build 1130. Anybody have a clue as to what's wrong?
urbaud

Regulae
Posts: 136
Joined: Tue Oct 20, 2009 6:05 am

Re: No BEEP

Post by Regulae » Tue Dec 07, 2010 5:06 am

Hi there,

This is a long shot, and you may have already covered it. You mention testing the loudness property- if you were trying the beepLoudness, this isn’t applicable for Mac or Windows. I did find that if I set the playLoudness to 0 it affected the beep volume. So you could check the playLoudness, for which 100 is maximum volume. If you’ve already tried this then please excuse the repetition. I’m running under Windows XP by the way, so I can’t really speak for Mac.

Regards,

Michael

urbaud
Posts: 120
Joined: Tue Feb 24, 2009 12:10 am

Re: No BEEP

Post by urbaud » Tue Dec 07, 2010 5:37 am

Hi Michael,
Thanks for your reply. First off, I was not aware of the playloudness command. I tried it, but it had no effect on beep. It sure worked fine with revSpeak. So, at this point it still isn't working. You don't suppose it's a bug, do you? Probably not, as I don't think any other forum members have complained about this. Anyway, thanks again for taking a stab at the problem.

Dan
urbaud

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: No BEEP

Post by Klaus » Tue Dec 07, 2010 12:17 pm

Hi all,

"the playloudness" actually sets the overall sound volume for the system, just like setting the volume in the appropriate system settings.
And "beep 4" works here on my Mac, although I do not really get 4 beeps, just 3 most of the time?

I have no idea what's going on on your machine, Dan, but it should at least beep 1!?
You could try a repeat loop with a short wait in it:

Code: Select all

...
repeat 4
  beep
  wait 500 millisecs with messages
end repeat
...
Best

Klaus

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: No BEEP

Post by bn » Tue Dec 07, 2010 2:57 pm

Hi Dan,

I dont know if this applies to your problem. But there is a problem with the beepLoudness on the Mac.

QualityControlCenter bug #7801

in short
Setting the beepLoudness to 16777472 restores the
maximum loudness of system sound without distortion. Any value between about
6500000 and 16777472 sets the beeploudness to audible.
This was tested on MacOX 10.5.7 Rev 3.0 and it still applies to MacOX 10.6.5 and Livecode 4.5.2.

Contrary to the documentation the beepLoundness has an effect on the Mac, just not within the range 0 to 100. (too low to be audible)

The documentation recomends for Linux systems
Set the beepLoudness to -1 to use the default system setting
On a Mac this did produce a horrible sound in MacOX 10.5.7, in MacOX 10.6.5 it makes a "plopp" (loud) subsequent beeps "plopp" but not as loud. setting the beepLoudness to 16777472 restores the system sound. This is just to tell you that you might not want to try to restore the system settings for the system beep on a Mac with -1.

I used to have the problem that a single beep does not produce a sound. I had to code beep 2 to get 1 beep. But this is not the case in the above configuration anymore.

Dan, you could try to set the beepLoudness to 16777472

for whatever it is worth

regards

Bernd

Regulae
Posts: 136
Joined: Tue Oct 20, 2009 6:05 am

Re: No BEEP

Post by Regulae » Tue Dec 07, 2010 3:11 pm

Hi all,

Although playLoudness evidently isn’t the problem in this case, I might mention that I was at first surprised that playLoudness affected beep volume. I’d assumed playLoudness only applied to players (as the name might suggest), but I see in the Dictionary:
If no audio clip, video clip, or player is specified, the setting of the playLoudness property applies to all sounds Revolution makes, including those made with the beep and play commands.
... which is handy to know (as Klaus indicated). Something that has caught me out in the past is setting the playLoudness to a low value, to make something in my stack play more softly, and neglecting to reset the playLoudness to the original value. This can inconvenience the user.

Like Klaus, I too have found that multiple beeps don’t always play as expected, but then I noticed in the Dictionary:
Cross-platform note:Windows and OS X do not execute the beepcommand if it's issued while a beep is playing. This means that if you specify a numberOfTimes on a Windows or OS X system, the user might hear fewer beeps because not all of them are sent to the speaker. To ensure that the user hears a specific number of beeps, use a loop with a waitcommand (where the wait time is at least as long as the beep sound's duration) after each beep.
... so it plays 1 beep just fine, but seems to “swallow” a beep if you want multiples, i.e. beep 2 gives you 1 beep, beep 3 gives you two beeps, and so on.

I wrote the above for the information of others who may be following this thread, but I see that the ever-reliable Bernd has zeroed in on a very plausible candidate for a solution, specific to OSX, which is what is needed. The “no beep” question is the sort of one I’m sure we are all interested in getting an answer to- nobody likes mysteries like this on any platform.

Regards,

Michael

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: No BEEP

Post by Klaus » Tue Dec 07, 2010 3:23 pm

Hi Michael,

you could also import a short (and compatible = in uncompressed AIFF and WAVE or compressed by nature AU format)
sound and use that as your beep. Control the playback then like this:

Code: Select all

...
repeat 4
  play ac "your beep sound here"
  wait until the sound is "done" with messages
end repeat
...
Best

Klaus

Regulae
Posts: 136
Joined: Tue Oct 20, 2009 6:05 am

Re: No BEEP

Post by Regulae » Tue Dec 07, 2010 5:18 pm

Hi Klaus,

That’s a really useful idea well worth mentioning. As it happens, I did something like that some time ago, when for interface purposes I wanted buttons to “click” rather than use the beep. The importance of your line:

Code: Select all

wait until the sound is "done" with messages
... was something I learned the (very) hard way. The controls were set up such that you could often generate “clicks” in quick succession. This worked fine on a Mac- when I transferred the project to run under Windows, my application would suddenly quit without warning or error message. It was also completely unpredictable. It took me quite some time (not to mention stress) to identify the problem- the “clicks” were being sent to the soundcard faster than they could be played, so they would “buffer”, leading to unpredictable behaviour. I’m confident this was the problem because, once the timing was corrected (as above) the instability completely disappeared.

Excuse my talking at length, but your suggestion triggered a “flash back” to a memorable case of bafflement. It was some years ago, perhaps before the Forum (at least, well before I knew of it) and I well remember the lonely experience of gazing blankly at the screen. Perhaps it’s why I’m so enthusiastic about this Forum, which gives people access to the knowledge of experienced LiveCoders such as yourself and others. It’s also what motivates me to sometimes include in answers information which, though perhaps not in direct response to the original question, may prove useful to future readers of the thread. Quite often these days I strike a problem and think “Now I know someone said something about that on the Forum...” and through the threads I hunt. The Forum is a wonderful resource, and it is a privilege to participate.

Regards,

Michael

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: No BEEP

Post by Klaus » Tue Dec 07, 2010 5:48 pm

Hi Michael,

glad I could help and refresh your memory :D


Best from ice-cold germany

Klaus

Regulae
Posts: 136
Joined: Tue Oct 20, 2009 6:05 am

Re: No BEEP

Post by Regulae » Tue Dec 07, 2010 6:46 pm

Hi Klaus,

Thanks for that trip down memory lane- "... the horror, the horror". Well I suppose I shouldn't complain, as it all sorted out in the end.

Best from rather hot Australia.

Regards,

Michael

urbaud
Posts: 120
Joined: Tue Feb 24, 2009 12:10 am

Re: No BEEP

Post by urbaud » Tue Dec 07, 2010 11:41 pm

Hi You Guys,

Thanks to all of you for replying to my post. Klaus, I tried the repeat loop you suggested-nada, nothing, zip, zero, etc. So, back to the drawing board, not really.

Bernd, you the MAN! I tried setting the beepLoudness to 16777472; what a wonderful sounding beep!! Then I tried 6500000, again what a wonderful sounding beep. Thanks to all of you, but especially you, Bernd, for solving the problem. And, it beeps even if I just use: beep 1. Also, keeping everything the same, using 16777472 provides better volume than using 6500000. Who knew? Ah, the German mind, it's a beautiful thing.

Now I can beep my way to Christmas. I'm trying to build a small program with different sounds for my granddaughter.

Dan
urbaud

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: No BEEP

Post by bn » Wed Dec 08, 2010 12:10 am

Hi Dan,
16777472 provides better volume than using 6500000. Who knew? Ah, the German mind
Well, we had an inflation in 1923 and those numbers were peanuts. That is the german angle on it I guess :)

Glad it works for you, I was not even shure whether that was the problem.

Merry Christmas to you, your family and especially your granddaughter.

but I thought it was jingle bell and not jingle beep :)

regards

Bernd

urbaud
Posts: 120
Joined: Tue Feb 24, 2009 12:10 am

Re: No BEEP

Post by urbaud » Wed Dec 08, 2010 5:19 am

Hi Bernd,
If I wanted to upload a Rev stack to one of my posts how would I do it?

Dan
urbaud

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: No BEEP

Post by bn » Wed Dec 08, 2010 9:34 am

Hi Dan,

you have to zip the stack first. (on your Mac you can control-click the stack and you will have the option to compress the file -> zip) Then below the textbox where you compose your message to the forum there is tab: Upload attachement. Click that and you have to choose the ziped file and click Add the file. This will upload the file.
I think the max size is 250 KB.

Kind regards

Bernd

urbaud
Posts: 120
Joined: Tue Feb 24, 2009 12:10 am

Re: No BEEP

Post by urbaud » Wed Dec 08, 2010 10:06 pm

Hi Bernd,
Thanks for the info on how to upload a stack. I also wanted to wish you and your family a: http://www.omniglot.com/soundfiles/chri ... as2_de.mp3

Dan
urbaud

Post Reply