Thread: streaming wave files through tapi

  1. #1
    Registered User subdene's Avatar
    Join Date
    Jan 2002
    Posts
    367

    streaming wave files through tapi

    Hello People,

    I have the following problem, and I was just wondering if someone could provide me with some advice. I will tell you my basic setup first. I have an external 56k voice/fax/data acer modem which connects to the serial port, and has mic and output sockets on the modem. I am on win xp pro,
    using visual studio for my IDE with c/c++ for the COM programming required when using TAPI 3.1.

    Currently, I am able to play wave files through the modem from my pc by selecting the appropriate terminal and outgoing media stream. I have also done the necessary conversion on the wave files so there is no conversion codec required. However, the quality of the sound is ok but I think it should be much better than it is at the moment.

    Instead of playing files programmatically through the pc to the modem, I decided to play the files through my pc speakers, and took the output from the pc speakers and fed it into the mic connection on the modem. Using this method, the sound quality is superb, and there is no distortion at all. But I really need to know if this is an acceptable method to achieve the results I require. I personally think that I should play the files programmatically through the pc.

    Any opinions or suggestions on this would be really helpful.

    Thanks, dene.
    Be a leader and not a follower.

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Let me see if I understand what you are doing....

    You are NOT transmitting audio via the modem over the phone lines.

    In both the surperb-quality and distorted-but-OK cases, you are listening to a speaker connected to the modem's speaker jack.

    When you run analog audio to the modem via the mic input, bypassing the serial port and the modem's Digital-To-Analog converter, the results are good.

    When you send digital audio to the modem via the serial port, the audio is inferior.

    Is that correct?

    -----------
    Most modems don't have a mic input. Most have only an internal speaker, so that you can hear the modem connecting. I assume that these extra features are for voice-mail.

    I'm not sure what sound quality to expect from the serial port. But, I wouldn't expect CD quality! You can get good quality with USB-2, but with a multitasking operating system, ANY streaming data is "difficult".

    I wouldn't expect high-speed, or high-resolution DACs & ADCs in a modem designed for voice mail. A phone-line has limited bandwidth and dynamic range, so there is no point to designing high-quality audio into a modem.

  3. #3
    Registered User subdene's Avatar
    Join Date
    Jan 2002
    Posts
    367
    Hi, thanks for the reply. Yes I am playing audio onto the telephone line. Currently, I can select a wave file on my pc, and play it through the computer, through the serial cable to the modem and the other person can hear it on the phone line. However, the quality is not that clear due to the conversion I have to do, as the modem only supports "Voice Sampling Rate: 8-bit monophonic audio data encoding at 11.025KHz or 7200Hz".

    However, if I play the same wave file through my pc speaker, taking the output from the speaker into the mic input on the modem the quality is much better (skipping the pc and serial cable). Therefore, I am unsure as to which is the best setup. Should I play it through pc, or skip this part and take the output from the pc speakers and feed it directly to the input of the modem (the mic socket). The second option is not really the best I dont think, as you dont have as much control. Additionally, the user can listen to anything from their pc, as it is being used by the modem.
    Be a leader and not a follower.

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Yeah, that 8-bit resolution is probably causing the distortion. I'm guessing that you original wave file is 16 bits, and perhaps a higher sampling rate. It's really impossible to generate a smooth-accurate audio waveform with 8-bits.

    It might seem low-tech to run an analog cable from the sound card to the modem, but since the sound card can work at higher bit-rates and higher resolution, that's going to give you better sound. Then, the main source of deterioration will be the limitations of the phone lines.
    Last edited by DougDbug; 05-11-2004 at 05:15 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading .dat files from a folder in current directory...
    By porsche911nfs in forum C++ Programming
    Replies: 7
    Last Post: 04-04-2009, 09:52 PM
  2. Compression/Decompression Wave File and MP3
    By cindy_16051988 in forum Projects and Job Recruitment
    Replies: 51
    Last Post: 04-29-2006, 06:25 AM
  3. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  4. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 02:41 PM
  5. Folding@Home Cboard team?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 398
    Last Post: 10-11-2005, 08:44 AM