• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

play sounds through modem

Hello

what the best/easiest way to play sounds through a modem.

Current we have a monitoring system that can run scripts when an event happens - like a failed ping. I want to make a script that does something like this

echo "atdt15554443333" >/dev/modem
#we might have to loop this a few times - since it will be hard to tell if the person has picked up
echo "System Down" | festival > /dev/modem
echo "+++ath0" >/dev/modem

Ideally I would like to use festival's text to speech capabiliy but I could deal with piping an mp3 as well.

Thanks for your help in advance
jculkincys
0
jculkincys
Asked:
jculkincys
  • 2
2 Solutions
 
slyongCommented:
Hi jculkincys,

There are pieces to glue the solution that you want together.  However, I know of it but never really try it myself and might not be able to guide you through fully.  This is what you need:

1)  First piece of puzzle is that you need vgetty (http://alpha.greenie.net/vgetty/).  Depending on your ditro, you might want to get the binary version.  For example the rpm can be found as mgetty-voice (http://rpmfind.net/linux/rpm2html/search.php?query=mgetty-voice).

2) Once that is installed, you need a Perl Module called Modem::Vgetty.  You can get it via CPAN or RPM (http://dries.ulyssis.org/rpm/packages/perl-Modem-Vgetty/info.html).

3) Next, a Perl script to dial out and say something into the modem can be found here: http://www.webreference.com/perl/tutorial/14/2.html.  Take note that you actually run the command "vm shell -l ttyS0 -S simple_alert.pl" to call the Perl script but not running the Perl script direct.

4) Final piece of the puzzle.. you need to use Festival TTS, you can use text2wave in Festival to convert first the text file into wav.  You can either hack up the whole thing into the Perl script in (3) or using another bash script.  This is a script (ref: http://uphone.org/diy/wavtormd) to convert from wav into rmd which is what vgetty need:

#!/bin/bash
#converts wav file to rmd  
#making sure wav file is
#8000khz and mono
#echo which .wav file would you like to convert to .rmd?
#read WAVNAME

# text2wave first...
if [ -z "$1" ]; then echo "usage is: texttormd textfile" exit fi
text2wave $1 -o tmp_text2wave
WAVNAME=$1 sox -v 2 tmp_text2wave -r 8000 -c 1 temp_$WAVNAME
wavtopvf temp_$WAVNAME | pvfspeed -s 8000 | pvftormd US_Robotics 1 > $WAVNAME.rmd  

# remove .wav suffix
NAME=$(echo $WAVNAME.rmd | sed -e "s/.wav.rmd/.rmd/")
mv $WAVNAME.rmd $NAME rm temp_$WAVNAME

# play thru modem
# vm play -s -v $NAME.rmd

Good luck.. and hope this gives you some help
0
 
jculkincysAuthor Commented:
Alright thanks alot I will look into all of that.

One quick follow up -
Do you think this modem would be capable of accomplishing this?
http://www.newegg.com/Product/Product.asp?Item=N82E16825152001

FYI:
I don't need to record sounds, just play them.
0
 
pjedmondCommented:
Looking at the spec, I'd have thought it would......(Important point is here to have a PCI modem or external modem that does the signal processing on the board. ***Avoid*** any PCI board that says "soft-modem"!! **avoid**any that say windows drivers only, **avoid** any that say anything about the main CPU controlling the data flow) rather than the cheap 'cut down' cards that require the processor to do much of the work.

However, from the feedback at the bottom of that page, I'd steer clear of it, and spend an extra $5 on a reputable brand.

http://www.newegg.com/Product/Product.asp?Item=N82E16825137111

http://www.3gplaza.com/estore/control/Computer3G/productdetails?id=48035 for further details - should manage 8KHz sampling

appears to have the necessary functionality, but you need to be really careful, as many of them are cut down versions which require the CPU to do some of the necessary work. A number of the $10-$20 modems also appear to have the necessary on-board controllers, but remarkably, many of them are still 'winmodems'.

If you're paying $6 for the delivery, you might as well get a decent modem. To be 100% sure that you've got a 'hardware modem' then you should buy an external modem.

http://www.newegg.com/Product/Product.asp?Item=N82E16825131003

seems to be recommended for this type of thing in a number of Linux forums, and:

http://www.newegg.com/Product/Product.asp?Item=N82E16825131005

should also be fine. Generally if they say that they have a 16550/A Compatible UART, then they should be fine for your needs.

(   (()
(`-' _\
 ''  ''
0
 
slyongCommented:
Hi jculkincys,

I am not sure about the modem from neweggs.  This is a list of modems that are testing with vgetty http://mgetty.greenie.net/modembase/bin/overview.pl?language=en look for the voice capability with *****
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now