Audio Sample Conversion

Audio Sample Conversion

Post by Tom » Wed, 01 Nov 2000 02:11:38



    Hi, I'm looking for help creating a function to convert audio samples
from one sample rate to another (22khz to 32khz for example).  I've already
tried the functions built into Visual C++ 6, but it doesn't seem to properly
convert the sample (my wave form looks like little stair-steps instead of
the pure sine wave I sent through it).
    Does anyone know of some good sample code I could use to do this?  I've
been searching around the web, but with no luck.

    Thanks in advance!


 
 
 

Audio Sample Conversion

Post by Eric Rong » Wed, 01 Nov 2000 06:31:57


Try asking in a newsgroup dedicated to Windows programming.  This is just
the language itself.


>     Hi, I'm looking for help creating a function to convert audio samples
> from one sample rate to another (22khz to 32khz for example).  I've
already
> tried the functions built into Visual C++ 6, but it doesn't seem to
properly
> convert the sample (my wave form looks like little stair-steps instead of
> the pure sine wave I sent through it).
>     Does anyone know of some good sample code I could use to do this?
I've
> been searching around the web, but with no luck.

>     Thanks in advance!


dashes)


 
 
 

Audio Sample Conversion

Post by Robert How » Wed, 01 Nov 2000 08:13:00


In general, the task of sample rate conversion requires interpolating the
original data stream (adding zero-value samples), filtering and then
decimating the result.  For your example (22 kHz -> 32 kHz), you would have
to upsample (interpolate) by a factor of 16 and then downsample (decimate)
by a factor of 11.  Doing this successfully requires some knowledge of DSP
techniques.

I don't know offhand of a source for a function that would fit your
particular case.  Much would depend on your specific requirements.  If you
are interested in pursuing this further, I did a Google search on "sample
rate conversion" and got 123,000 hits, so you might want to look there.

Bob Howe


>     Hi, I'm looking for help creating a function to convert audio samples
> from one sample rate to another (22khz to 32khz for example).  I've
already
> tried the functions built into Visual C++ 6, but it doesn't seem to
properly
> convert the sample (my wave form looks like little stair-steps instead of
> the pure sine wave I sent through it).
>     Does anyone know of some good sample code I could use to do this?
I've
> been searching around the web, but with no luck.

>     Thanks in advance!


dashes)

 
 
 

1. How to set the audio sample number in each audio media sample object?

In the DirectShow, the raw data(video frame, audio
samples) are parsed into a COM object called "media
samples" and delivered from the output pin of the source
filter to the input pin of the downstream filter. A media
sample object containing video data holds the data for one
video frame. For audio, a media sample object holds the
data for SEVERAL audio samples.

My question is, how can I set the audio sample number for
each audio media sample object? For example, each audio
media sample object contains exactly 10ms's audio samples?
The default is wrapping 500ms's audio samples (I guess) to
one object, which introduces extra latency if delivered to
Internet.

2. Read Me Third

3. Audio Conversion

4. Preserving IX/IY registers...

5. Application and Source of FilterGraph Audio Conversion

6. A bug "Why FAT block data is updated after 15sec delay ?" in Win2000

7. how to calculate the average of audio sample values in a frame

8. Invalid Pages

9. Accessing Audio Data in an Interleaved DV Sample

10. Playing multiple audio samples continuously without gapping ?

11. Free professional audio samples!!!!

12. conversion HSL to RGB and vice versa, sample code?