EzDevInfo.com

beep.js

Beep is a JavaScript toolkit for building browser-based synthesizers. Beep.js beep is a javascript toolkit for building browser-based synthesizers.

Is there a way to play a system beep on Mac OS?

Is there a way to play a system beep on Mac OS using C++ and Xcode? I understand that I need to use a library. Is there a library that works across both the Mac and Windows platforms?


Source: (StackOverflow)

has Iphone built in beep sound effect

hi i need to use beep on iphone, but the only thing i have found is this

NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"alert" ofType:@"wav"];

    SystemSoundID soundID;

    AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath: soundPath], &soundID);

    AudioServicesPlaySystemSound (soundID);

    [soundPath release]; 

it is working and good code but i need to import the alert.wav file.But i rather do this with native (built in) sounds if there exist.

thanks for all the answers cs.


Source: (StackOverflow)

Advertisements

Turn music on/off button Console.Beep

I have a button with text that says Music On/Off.

With the following Console.Beep() code:

private void button1_Click(object sender, EventArgs e)
{
    Console.Beep(659, 125);
    Console.Beep(659, 125);
    Thread.Sleep(125);
    Console.Beep(659, 125);
    Thread.Sleep(167);
    Console.Beep(523, 125);
    Console.Beep(659, 125);
    Thread.Sleep(125);
    Console.Beep(784, 125);
    Thread.Sleep(375);
    Console.Beep(392, 125);
    Thread.Sleep(375);
    Console.Beep(523, 125);
    Thread.Sleep(250);
    Console.Beep(392, 125);
    Thread.Sleep(250);
    Console.Beep(330, 125);
    Thread.Sleep(250);
    Console.Beep(440, 125);
    Thread.Sleep(125);
    Console.Beep(494, 125);
    Thread.Sleep(125);
    Console.Beep(466, 125);
    Thread.Sleep(42);
    Console.Beep(440, 125);
    Thread.Sleep(125);
    Console.Beep(392, 125);
    Thread.Sleep(125);
    Console.Beep(659, 125);
    Thread.Sleep(125);
    Console.Beep(784, 125);
    Thread.Sleep(125);
    Console.Beep(880, 125);
    Thread.Sleep(125);
    Console.Beep(698, 125);
    Console.Beep(784, 125);
    Thread.Sleep(125);
    Console.Beep(659, 125);
    Thread.Sleep(125);
    Console.Beep(523, 125);
    Thread.Sleep(125);
    Console.Beep(587, 125);
    Console.Beep(494, 125);
    Thread.Sleep(125);
    Console.Beep(523, 125);
    Thread.Sleep(250);
    Console.Beep(392, 125);
    Thread.Sleep(250);
    Console.Beep(330, 125);
    Thread.Sleep(250);
    Console.Beep(440, 125);
    Thread.Sleep(125);
    Console.Beep(494, 125);
    Thread.Sleep(125);
    Console.Beep(466, 125);
    Thread.Sleep(42);
    Console.Beep(440, 125);
    Thread.Sleep(125);
    Console.Beep(392, 125);
    Thread.Sleep(125);
    Console.Beep(659, 125);
    Thread.Sleep(125);
    Console.Beep(784, 125);
    Thread.Sleep(125);
    Console.Beep(880, 125);
    Thread.Sleep(125);
    Console.Beep(698, 125);
    Console.Beep(784, 125);
    Thread.Sleep(125);
    Console.Beep(659, 125);
    Thread.Sleep(125);
    Console.Beep(523, 125);
    Thread.Sleep(125);
    Console.Beep(587, 125);
    Console.Beep(494, 125);
    Thread.Sleep(375);
    Console.Beep(784, 125);
    Console.Beep(740, 125);
    Console.Beep(698, 125);
    Thread.Sleep(42);
    Console.Beep(622, 125);
    Thread.Sleep(125);
    Console.Beep(659, 125);
    Thread.Sleep(167);
    Console.Beep(415, 125);
    Console.Beep(440, 125);
    Console.Beep(523, 125);
    Thread.Sleep(125);
    Console.Beep(440, 125);
    Console.Beep(523, 125);
    Console.Beep(587, 125);
    Thread.Sleep(250);
    Console.Beep(784, 125);
    Console.Beep(740, 125);
    Console.Beep(698, 125);
    Thread.Sleep(42);
    Console.Beep(622, 125);
    Thread.Sleep(125);
    Console.Beep(659, 125);
    Thread.Sleep(167);
    Console.Beep(698, 125);
    Thread.Sleep(125);
    Console.Beep(698, 125);
    Console.Beep(698, 125);
    Thread.Sleep(625);
    Console.Beep(784, 125);
    Console.Beep(740, 125);
    Console.Beep(698, 125);
    Thread.Sleep(42);
    Console.Beep(622, 125);
    Thread.Sleep(125);
    Console.Beep(659, 125);
    Thread.Sleep(167);
    Console.Beep(415, 125);
    Console.Beep(440, 125);
    Console.Beep(523, 125);
    Thread.Sleep(125);
    Console.Beep(440, 125);
    Console.Beep(523, 125);
    Console.Beep(587, 125);
    Thread.Sleep(250);
    Console.Beep(622, 125);
    Thread.Sleep(250);
    Console.Beep(587, 125);
    Thread.Sleep(250);
    Console.Beep(523, 125);
    Thread.Sleep(1125);
    Console.Beep(784, 125);
    Console.Beep(740, 125);
    Console.Beep(698, 125);
    Thread.Sleep(42);
    Console.Beep(622, 125);
    Thread.Sleep(125);
    Console.Beep(659, 125);
    Thread.Sleep(167);
    Console.Beep(415, 125);
    Console.Beep(440, 125);
    Console.Beep(523, 125);
    Thread.Sleep(125);
    Console.Beep(440, 125);
    Console.Beep(523, 125);
    Console.Beep(587, 125);
    Thread.Sleep(250);
    Console.Beep(784, 125);
    Console.Beep(740, 125);
    Console.Beep(698, 125);
    Thread.Sleep(42);
    Console.Beep(622, 125);
    Thread.Sleep(125);
    Console.Beep(659, 125);
    Thread.Sleep(167);
    Console.Beep(698, 125);
    Thread.Sleep(125);
    Console.Beep(698, 125);
    Console.Beep(698, 125);
    Thread.Sleep(625);
    Console.Beep(784, 125);
    Console.Beep(740, 125);
    Console.Beep(698, 125);
    Thread.Sleep(42);
    Console.Beep(622, 125);
    Thread.Sleep(125);
    Console.Beep(659, 125);
    Thread.Sleep(167);
    Console.Beep(415, 125);
    Console.Beep(440, 125);
    Console.Beep(523, 125);
    Thread.Sleep(125);
    Console.Beep(440, 125);
    Console.Beep(523, 125);
    Console.Beep(587, 125);
    Thread.Sleep(250);
    Console.Beep(622, 125);
    Thread.Sleep(250);
    Console.Beep(587, 125);
    Thread.Sleep(250);
    Console.Beep(523, 125);
    Thread.Sleep(625);
}

My question is how do I tell the button to turn off the music if its clicked again, and then turn the music back on if its clicked again and so on and so forth.


Source: (StackOverflow)

How to disable the beep in emacs on Windows

Hi I'm new to Emacs and I downloaded GNU emacs on my windows machine. I just finished the short tutorial but I found there's a beep sound whenever I hit the beginning/end of a file and in many other cases, which is a little disturbing to me.

I searched online and I found people saying putting this

(setq visible-bell 1)

in my .emacs file, but I don't know how to do that. First, where is my .emacs file and what is it? Or is there another way to do it? I mean in the emacs window menu there is Options -> Customize Emacs but I couldn't find where the setting is. I feel like it's kind of hard to find things in there unless you already know where it is.


Source: (StackOverflow)

How to beep using PC speaker?

I want to make a beep sound using PC speaker in C#. When using the following code:

[DllImport("kernel32.dll", EntryPoint = "Beep", SetLastError = true,
ExactSpelling = true)]
public static extern bool Beep(uint frequency, uint duration);

static void Main()
{
    while (true)
    {
        Beep(1000, 500);
        Thread.Sleep(2000);
    }
}

instead of beeping through the PC speaker, it simply outputs a sound of a given frequency and duration to the default sound device (as a headset for example). The same thing happens when using Console.Beep().

Why?

Notes:

  • The PC speaker is on. When I start the PC, it beeps.

  • The OS is Windows 8.


Source: (StackOverflow)

Beep library for Java?

In Java, is there any functions that can emit a (motherboard) beep with a given frequency and duration? In many languages I've worked with, you can; Beeps are useful for indicating certain types of errors, also for easily generating music.

The standard way to beep would be either print the BEEP character (\007 or something) or to use Toolkit.beep(), neither of which allows you to specify frequency and duration.

I'm thinking of implementing a native method, but there should be a library somewhere to do this simple task. I'm looking for something like SomeClass.beep(500,1000);

My application will only be supported on Windows.

Thanks.


Source: (StackOverflow)

Strange beep when using cout

today when I was working on some code of mine I came across a beeping sound when printing a buffer to the screen. Here's the mysterious character that produces the beep: '' I don't know if you can see it, but my computer beeps when I try to print it like this:

cout<<(char)7<<endl;

Another point of interest is that the 'beep' doesn't originate from my on board beeper, but from my headphone/speaker

Is this just my computer or there something wrong with the cout function?

EDIT:

But then why does printing this character produce the beep sound? does that mean that I could send other such characters through the cout function to produce different effects?


Source: (StackOverflow)

Windows - Can console output inadvertently cause a system beep?

I have a C# console application that logs a lot to the console (using Trace). Some of the stuff it logs is the compressed representation of a network message (so a lot of that is rendered as funky non-alphabetic characters).

I'm getting system beeps every so often while the application is running. Is it possible that some "text" I am writing to the console is causing them?

(By system beep, I mean from the low-tech speaker inside the PC case, not any kind of Windows sound scheme WAV)


If so, is there any way to disable it for my application? I want to be able to output any possible text without the it being interpreted as a sound request.


Source: (StackOverflow)

vb.net system beep sound on XP

Is it possible to have a vb.net program sound the PC's internal speaker? you know the one that produces C's \a BELL I have tried beep(), but this only produces the error sound on the sound card. I have also tried

<Runtime.InteropServices.DllImport("KERNEL32.DLL", EntryPoint:="Beep", SetLastError:=True, _
CharSet:=Runtime.InteropServices.CharSet.Unicode, ExactSpelling:=True, _
CallingConvention:=Runtime.InteropServices.CallingConvention.StdCall)> _
Public Shared Function _
   aBeep(ByVal dwFreq As Integer, ByVal dwDuration As Integer) _
     As Boolean
End Function

With no joy apparently its only good on Vista and above. Any suggestions?


Source: (StackOverflow)

Disable system beep on TSpinEdit when pressing Enter

I have a default button on a form that has a TSpinEdit control on it. When the TSpinEdit control has the focus and the user presses the Enter key, instead of the default button getting clicked, the user just hears a system beep because the Enter key is invalid for a TSpinEdit.

Normally, to avoid the beep, I would use the OnKeyPress event and set the Key := 0 to skip the key press. I could then execute the click method on the default button. However, in this case, OnKeyPress doesn't fire because the Enter key is not valid.

OnKeyDown fires, but when I set Key := 0 there, it doesn't stop the system beep.

So, how do I disable the system beep when pressing the Enter key on a TSpinEdit control?

I'm on Delphi 5, and they didn't include the source for Spin.pas.


Source: (StackOverflow)

Avoid Windows 'Ding' when Enter is pressed in TextBox with OnKeyUp

If a user hits enter in a windows forms textbox with a KeyUp Event, windows sounds a beep or ding. I could not determine why this happens and how I could avoid this.

Any help would be appreciated.


Source: (StackOverflow)

Play Beep Sound in iphone Related to the Frequency & Decibels

I have researched about to play a beep sound in iphone related to the frequency & decibels that i have given.

Links i referred:

http://developer.apple.com/library/ios/#samplecode/MusicCube/Introduction/Intro.html#//apple_ref/doc/uid/DTS40008978

http://www.politepix.com/2010/06/18/decibel-metering-from-an-iphone-audio-unit/

http://atastypixel.com/blog/using-remoteio-audio-unit/

http://www.politepix.com/2010/06/18/decibel-metering-from-an-iphone-audio-unit/

How to play a sound of paticular frequency and framework not found AudioUnit question

Also i have used Flite to do text to speech in my application.

May i know , is it possible to play a beep sound in iphone related to the frequency & decibels using flite.

I know that they are creating a audio file as per the input(only related to the pitch,variance,speed and given string) and playing through it Audioplayer once created.

But they have no custom methods to set the frequency & decibels!!!!

So could any one provide me a good way to do it in iphone.

Any help on this question is appreciated.

Thanks


Source: (StackOverflow)

Beep on Linux in C

I want to generate a beep sound with a specific frequency and length (for different sound signals) using the system beeper (and only the speakers if beeper is not available / accessible). I know it is possible to do this by using ioctl, but that requires root access, which I don't want.

I know I could just use the "beep" command, but that would be a dependency, which, if possible, shouldn't be used (no external dependencies at all, just the basic linux libraries and C).

What I currently have is the following code (but this requires superuser privileges to run):

#include <stdlib.h>
#include <fcntl.h>
#include <linux/kd.h>

int main(int argc, char *argv[])
{
 int fd = open("/dev/console", O_RDONLY);
 if (fd == -1 || argc != 3) return -1;
 return ioctl(fd, KDMKTONE, (atoi(argv[2])<<16)+(1193180/atoi(argv[1])));
}

If there is no other way to do this, then I will use beep, but I would really like to avoid dependencies and integrate the beep directly into my script, but I'm sure somebody here will know a solution / workaround.

I don't really want external libraries as the program should be as lightweight as possible.


Source: (StackOverflow)

PC Speaker beep via javascript?

I'm revisiting an ID scanner station program we built ages ago and I have a request from users to make a system beep. We're considering moving the system to a web browser, but is it possible to invoke a speaker beep via javascript or something? It doesn't need to be cross-browser compatible, but it probably needs to work on Windows or Linux. The stations in question are not equipped with a soundcard or external speakers, hence the request for a PC speaker access.

I know someone's going to say it, so I'll address this up front: I don't care what you think about applications making noise, this isn't for you. Users request it, it makes sense, and the hardware scanner already makes noise anyways. Yes, we give visual feedback, with distinguishable text and color, but we find that people accept the existing beep as positive feedback and adding more audio context would help.


Source: (StackOverflow)

faster alternative to windows.h's Beep()

I'm working on a personal project. I want to transmit some data over the air with an old ham radio.

My first draft application works like that :

I construct one byte with 4 "signals" :

  • 5000hz means "00"

  • 6khz means "01"

  • 7khz means "10"

  • 8khz means "11"

  • 9khz means same as the previous one

then I merge those 4 couple of bits together and start again with the next one.

The demodulation works great and should be fast enough, but I'm having an issue with the sound generation... it's slow...

Here's my debug code :

#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
Beep( 5000, 100 );
Beep( 6000, 100 );
Beep( 7000, 100 );
Beep( 8000, 100 );
Beep( 9000, 100 );
return 0;
}

I'm expecting 5 beeps, close together, 100ms each but here's what I get (on top, five "100ms Beeps(), and on the bottom, five "20ms Beeps()" : a

As you can see, what I get is 50ms beeps followed 75ms pause when I want 100ms beeps, and 10ms beeps followed by 100ms pause when I want a 20ms beep.

Is there something faster and more accurate than Beep() for Windows ? (something that works with linux as well would be even better because the final application should work on a raspberry pi)

I would get the higher usable bandwidth with 3ms sounds (.... 41 bytes/sec.... which is more than enough for my application)

Compiler : g++ (mingw)

Os : seven 64bits


Source: (StackOverflow)