473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,320 developers and data experts.

How to play a wave file on the phone (C#) - PART I

Our goal here: We want the PC to call a designated phone number when something happens, and report it in easy-to-understand spoken audio snippets which are saved in the form of pre-recorded wave files.

PART I: Find out about your modem's capability.

Most modems can be classified with these characteristics:

Data/fax
Data/fax/voice
Data/fax/voice/speakerphone

In our case here, the modem at least has to support the voice feature. The easiest way to find out if your modem supports voice is to run the HyperTerminal to use AT commands.

Run HyperTerminal and use the following commands:

ATZ

The modem should respond with "OK"

AT+FCLASS=8

If your modem supports voice, it should come back with "OK". Otherwise, "ERROR".

If you are interested, you can type AT+FCLASS=?
The modem should respond with something like: 0,1, 2, 8.

0: Data

1,2: Fax

8: Voice

If it turns out you don't have a voice modem, then we're stuck. If you want to go further with this approach, you'll need to install a modem with voice capability.

Now, if you do have a voice modem, you need to find out about its capabilities regarding the voice data formats it can handle. Use the following AT command to find out:

AT+VSM=? (Remember that AT+FCLASS=8 must be sent prior to sending this command.)

Our modem here comes back with the following:

AT+VSM=?
128,"8-BIT LINEAR",(7200,8000,11025)
129,"16-BIT LINEAR",(7200,8000,11025)
130,"8-BIT ALAW",(8000)
131,"8-BIT ULAW",(8000)
132,"IMA ADPCM",(7200,8000,11025)

OK


We interpret this as: Our modem supports 5 different methods of encoding voice data. If you are interested in learning more about these methods, just Google them. In this example, we will focus on the first method (the simplest one). This method uses 8-bit linear (signed numbers) and supports the following sampling rates:

7200, 8000, or 11025 samples per second.

In theory, most human voice frequency falls between 1kHz to 4kHz. Sampling theory (Nyquist) indicates that you will have to take at least 8kHz in order to reconstruct voice content up to 4kHz. Higher than 8kHz would be better to avoid anti-aliasing. However, higher sampling rates come with the price of heavier data load.

Now, come back to our example, we will choose: 8000 samples per second which is 8kHz. We tell the modem our selection by typing the command:

AT+VSM=128, 8000 (Should get "OK" back.)

Following the above procedure, you should now know if your modem supports voice, and if so, what voice data format it uses. You have to choose the data format now in order to prepare the wave file which will be the topic in PART II .
Sep 5 '07 #1
2 19324
Part II ?? .................................................. .......
Dec 13 '07 #2
RedSon
5,000 Expert 4TB
Part 2 -> http://www.thescripts.com/forum/thread704379.html
Dec 18 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Bill Dandreta | last post by:
I posted a message ("Help with my 1st Tkinter program") a few days ago complaining that Python did not have any built in basic cross platform sound capability. I was wrong (at least partly). Python...
4
by: Dennis M. Marks | last post by:
This is a simple question. How do I preload a wave file and play it on command? -- Dennis M. Marks -----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com -...
1
by: DaniloAlmeida | last post by:
Hi everyone, How are you ? Happy new year for all !!! Well I want to know how can I find some data like a tone in a recorded wave file in WindowsPCM format in 11kHz - 8bits. This file(s)...
9
by: Morris Neuman | last post by:
Im working with VS 2005 and trying to use a Hyperlink field in a datagrid to play a wave file that is not located in the website folders but is in a plain folder on the same machine, windows 2003...
4
by: I Hate My Computer | last post by:
Hi, I am looking to play a wave file in visual basic. I would like it to play from the resource file. I have added the wave file but how do I get it to play? I do have this code. Dim Sound As New...
1
by: homevista | last post by:
Part II: Wave file - How to read to a buffer Wave (or Wav) is the standard format for storing audio data on the PC. As software developers, we are interested in the internal structure of the file...
6
by: homevista | last post by:
PART III: Putting things together In part I we examined the modem to verify that it supported voice. If so, we took a note about the voice data format that we would use. In the second part, we...
5
by: Slickuser | last post by:
I want to play a note in C# .NET giving a frequency like the one show below. Is it possible? C 261.6 C# 277.2 D 293.7 D# 311.1 E 329.6
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.