The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unix Make mmipko High Level Programming 3 11-23-2007 02:18 PM
Make a copy of a unix HDD josramon UNIX for Dummies Questions & Answers 0 03-20-2007 07:57 AM
how to make VI editor show colors in Unix whatisthis Shell Programming and Scripting 7 05-26-2006 10:57 PM
Make file in Unix gandhevinod UNIX Desktop for Dummies Questions & Answers 6 04-20-2005 04:15 PM
How can I make ls -l in HP-UNIX? sangjinn High Level Programming 1 09-24-2001 02:39 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-09-2007
Registered User
 

Join Date: Dec 2007
Posts: 8
Stumble this Post!
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.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-10-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Stumble this Post!
Code:
int main(int argc,char **argv) {
printf("%c",7);
return 0;
}
also see

Xlib Programming Manual: XBell
Reply With Quote
  #3 (permalink)  
Old 12-10-2007
Registered User
 

Join Date: Dec 2007
Posts: 8
Stumble this Post!
Question thanks

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

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 ?
Reply With Quote
  #4 (permalink)  
Old 12-10-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Stumble this Post!
Quote:
Originally Posted by trapeze View Post
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 View Post
2. (int argc, char **argv)......... what is this ?
C programming 101

Quote:
Originally Posted by trapeze View Post
3. the sound was like ... dong...dong... are there more sharp sounds ?
Refer to your terminal/emulation.
Reply With Quote
  #5 (permalink)  
Old 12-10-2007
Registered User
 

Join Date: Nov 2007
Posts: 25
Stumble this Post!
Did you try use '\a' i.e.:
Code:
printf("Something\a");
Reply With Quote
  #6 (permalink)  
Old 12-10-2007
Registered User
 

Join Date: Dec 2007
Posts: 8
Stumble this Post!
Question ?

Quote:
Originally Posted by SebaM6 View Post
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
Reply With Quote
  #7 (permalink)  
Old 12-10-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Stumble this Post!
Quote:
Originally Posted by trapeze View Post
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0