How to make sound using C under UNIX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to make sound using C under UNIX
# 1  
Old 12-10-2007
Question How to make sound using C under UNIX

i'm programming using C under UNIX. i wonder to how make sound using C ? any sound like "beep" would be fine. thx. Smilie
# 2  
Old 12-10-2007
Code:
int main(int argc,char **argv) {
printf("%c",7);
return 0;
}

also see

Xlib Programming Manual: XBell
# 3  
Old 12-10-2007
Question thanks

thanks... it worked. however, some questions. Smilie

1. i tried 8 and 6 instead of 7 but did not work. why ? what's magical about this 7 ? lucky 7 ?

2. (int argc, char **argv)......... what is this ?

3. the sound was like ... dong...dong... are there more sharp sounds ?
# 4  
Old 12-10-2007
Quote:
Originally Posted by trapeze
1. i tried 8 and 6 instead of 7 but did not work. why ? what's magical about this 7 ? lucky 7 ?
Find an ASCII table.

Quote:
Originally Posted by trapeze
2. (int argc, char **argv)......... what is this ?
C programming 101

Quote:
Originally Posted by trapeze
3. the sound was like ... dong...dong... are there more sharp sounds ?
Refer to your terminal/emulation.
# 5  
Old 12-10-2007
Did you try use '\a' i.e.:
Code:
printf("Something\a");

# 6  
Old 12-11-2007
Question ?

Quote:
Originally Posted by SebaM6
Did you try use '\a' i.e.:
Code:
printf("Something\a");

thanks...it still gives dong dong sound...not like sharp beep beep sound...maybe it's related to my laptop's(i'm using laptop to get connected to remote server) or the server's terminal settings.. which i've no ideas at all Smilie
# 7  
Old 12-11-2007
Quote:
Originally Posted by trapeze
any sound like "beep" would be fine
So we're getting picky now?

A serial terminal normally has a single bell which it will sound on receipt of the ASCII bell character. The program has no control over this because all it sends is the bell character, what the terminal does with that is up to it.

XBell gives you a little more control on an X terminal, but not much more.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Make bold chars in UNIX

Hi all, I want to make the string as bold in unix. is there any way to acheive this? thanks in advance. (16 Replies)
Discussion started by: SekhaReddy
16 Replies

2. HP-UX

HP-unix make file Problem

Dear Unixians, I have try to link my libraries with tuxedo that showing following errors, ] My make file few lines: .... actual linking regards, kkl (1 Reply)
Discussion started by: kkl
1 Replies

3. Hardware

How to make terminals with a PC(UNIX/LInux) support?

I want to build a network, in this network there is only one PC and 50 terminals, 50 students can use this system to study UNIX/Linux. In the old days, computer was very expensive, many scientists shared a computer with terminals, that means a terminal has no cpu, memory and hardisk. In... (5 Replies)
Discussion started by: haixiao_liu
5 Replies

4. UNIX for Dummies Questions & Answers

Does Unix make clob or blob objects

Hi I have a log file stored in unix file server i need to prepare the clob object of that and store in Oracle Database. Please suggest me or give me some examples Thanks Raj (0 Replies)
Discussion started by: rajeshorpu
0 Replies

5. Solaris

how to make file link in c under unix

how to make link command by c language (2 Replies)
Discussion started by: ma7moudax
2 Replies

6. Programming

Unix Make

I need tutorial on Make utility on Unix. Any help or link appreciated. many thanks Mirko (3 Replies)
Discussion started by: mmipko
3 Replies

7. UNIX for Dummies Questions & Answers

Make a copy of a unix HDD

i have this HDD with SCO 5.0.6 and i'm getting this errors WARNING: wd0: Error on fixed disk dev 1/42, block=4829, cmd=0x000000C8 Sun Mar 11 05:50:08 2007 status=0x00000040, LBA sector=1285723, cylinder/head=5022/0 WARNING: wd0: Error... (0 Replies)
Discussion started by: josramon
0 Replies

8. Shell Programming and Scripting

how to make VI editor show colors in Unix

Hi, I saw some people's vi editor show different colors on the text according the nature of text when using it. It would be nice if I can see diffrerent colors with my vi editor. Do anybody know how to set it up? I use PowerTermPro program to access unix machine. I tried to use vim editor but... (7 Replies)
Discussion started by: whatisthis
7 Replies

9. UNIX Desktop Questions & Answers

Make file in Unix

How to make files in Unix (6 Replies)
Discussion started by: gandhevinod
6 Replies

10. Programming

How can I make ls -l in HP-UNIX?

I made a liitle source about that.. BUt I got a trouble when making files'authority.. How can I display them?? p.s.) used struct stat .. (1 Reply)
Discussion started by: sangjinn
1 Replies
Login or Register to Ask a Question