LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-18-2017, 12:12 PM   #16
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148

beep manpage
userx@slackwhere⚡️~⚡️$ sudo chmod 4755 /bin/beep
userx@slackwhere⚡️~⚡️beep -f 750 -l 600 -r 1
turn on speakers within the system
Code:
#!/bin/bash

count=0

while [ count -lt '10' ] ; do

sleep 30
beep -f 750 -l 600 -r 1
((++count))
done
https://bbs.archlinux.org/viewtopic.php?id=117309
and
https://wiki.archlinux.org/index.php/PC_speaker
and
http://askubuntu.com/questions/19906...pt-not-working

Last edited by BW-userx; 03-18-2017 at 12:19 PM.
 
Old 03-18-2017, 12:48 PM   #17
danielbmartin
Senior Member
 
Registered: Apr 2010
Location: Apex, NC, USA
Distribution: Mint 17.3
Posts: 1,814

Rep: Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639
I found it necessary to change this ...
Code:
while [ count -lt '10' ]
... to this ...
Code:
while [ $count -lt '10' ]
Daniel B. Martin
 
Old 03-18-2017, 12:51 PM   #18
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
Quote:
Originally Posted by danielbmartin View Post
I found it necessary to change this ...
Code:
while [ count -lt '10' ]
... to this ...
Code:
while [ $count -lt '10' ]
Daniel B. Martin
thank you - good job!

Last edited by BW-userx; 03-18-2017 at 12:53 PM.
 
Old 03-26-2017, 11:46 PM   #19
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
For the real-world requirement as you describe it, you don't need any programming at all. You could simply create an audio file with 60 seconds of silence followed by a sound.

It is not difficult to create such a file in Audacity (for example), then export it to an MP3 file, load it into any music-player application on your computer or smartphone, and press the play button to start the delayed-sound sequence.

I did something like this when I needed a smartphone interval timer (repeated intervals marked by a short sound). I looked for an interval timer app but could not find one that I liked. They either kept the screen backlight on, or fell asleep when I forced the screen off. So I made a sound file with a distinctive tone every 60 seconds for a total of 30 minutes. I need this sort of thing for cooking.

The main drawback of this system is that you need to create a different audio file for every time interval you might need. I use only two different time intervals around the kitchen, so I only had to create two audio files.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to play sound directly from input on USB sound card, a Sound Blaster X-Fi THX JunctaJuvant Other *NIX 10 06-14-2014 02:36 AM
Could someone program a SH / Bash program with Zenity to play radio based on a site? frenchn00b Programming 2 02-25-2011 04:16 PM
How to write C Code to play MP3 files using Open sound System programming Under Linux shayad15 Programming 3 06-05-2006 12:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration