Re: about wave

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 02/23/05


Date: Wed, 23 Feb 2005 01:50:48 -0500

When I was doing this we had a problem if the two 16-bit values added up to > 32767 or <
-32768. We converted both integers to floats, did the add, then scaled it by a "volume
level" the user set with a slider. If it was outside the bounds, it was set to the max
value rather than letting it overflow. In another app, we had the leisure to read the two
files, build an internal "wave" entirely in floating point, keep track of the max, and
select the scaling automatically.

I believe there is an audio mixer capability in XP which can combine two or more streams
itself, but I've not done anything in the DirectSound area so I'm not sure how to use it.
                                        joe

On Tue, 22 Feb 2005 20:30:09 -0500, "Scott McPhillips [VC++ MVP]" <scottmcp@mvps.org>
wrote:

>"john_wong" <john_wong@192.168.1.2> wrote in message
>news:%230PmWRKGFHA.1528@TK2MSFTNGP09.phx.gbl...
>>I want to combine two or more wave files into a .wave file,and play it.
>> The source .wav file is dynamic,so I need write code to combine them by
>> myself.
>> I read the document about .wav file format,and find it is complex.
>> Who can give me a easy way to do it?
>> or give me some code as reference.
>> Thanks.
>
>Sample code for reading and writing a WAV file and manipulating the audio
>samples is in MSDN. Search for "Reverse" sample.
>
>If you want to mix two sounds together, and if the data format is 16-bit PCM
>samples, simply add the sample values together.
>
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm



Relevant Pages

  • Re: How do I convert music from a cd or mpeg into a wav file?
    ... to wave (small filesize, for example 3,65MB mp3>3,65MB wave. ... RIP your CD into MP3 or WMA format, which you can use in PowerPoint. ... http://audacity.sourceforge.net/ Keeping in mind that your WAV file cannot ...
    (microsoft.public.powerpoint)
  • Re: background sound - ie6 and w98se
    ... MS MVP - Outlook Express ... but no wav file gets loaded. ... that OE only accepts .wav & midi files without third party help. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Moving a file from A to B fails with incorrect syntax error
    ... I think OP is wondering why the .wav file won't move or copy. ... but the error message i get is ... I am running on a vista home premium machine, using visual studio 6 if ... Visual C++ MVP ...
    (microsoft.public.vc.mfc)
  • Re: Lost audio where video clip was dropped
    ... Try it as a WMA or WAV file to see if that works, ... MVP - Windows Digital Media ... I've dropped still photos in, but where I dropped an avi video clip (with ...
    (microsoft.public.windowsxp.moviemaker)
  • Re: TAPI & Dialogic D/4 PCI returns LINEERR_NODEVICE when doing a lineGetiD with device class of
    ... Is there a Dialogic wave drivers which needs to be installed and/or ... I have no idea if Dialogic supports a wave device on a call or line ... when it is connected (and they support call based) then that should be ... > I need some help in playing a wav file on a Dialogic D/4 PCI. ...
    (microsoft.public.win32.programmer.tapi)