Questions of RAW audio files
  Home FAQ Contact Sign in
microsoft.public.win32.programmer.directx.audio only
 
Advanced search
POPULAR GROUPS

more...

microsoft ... directx.audio Profile…
 Up
Questions of RAW audio files         


Author: dh
Date: Aug 25, 2008 19:15

I have some questions of raw audio files...

1. Audio files of extension .raw are raw audio file. Just wondering how a
player can interpret the data inside such kind of files, since their audio
like sampling rate etc. are not available. Right?

2. For such an audio file to be import or played back, info about such file
needs to be provided besides the .raw file itself, right?

3. If 1 and 2 are correct, then why the Audacity Audio Editor can import is
and display its info as: Signed 16-bit PCM, LE, Mono and SR of 44100 Hz?

3. What player can play such file?

4. My goal with such raw audio files is to convert them to MP3. Could
someone suggest how this is possible with Directshow?

Thanks!
4 Comments
Re: Questions of RAW audio files         


Author: Chris P.
Date: Aug 26, 2008 06:41

On Mon, 25 Aug 2008 19:15:02 -0700, dh wrote:
> I have some questions of raw audio files...
>
> 1. Audio files of extension .raw are raw audio file. Just wondering how a
> player can interpret the data inside such kind of files, since their audio
> like sampling rate etc. are not available. Right?

Correct, it can't.
> 2. For such an audio file to be import or played back, info about such file
> needs to be provided besides the .raw file itself, right?

Correct.
> 3. If 1 and 2 are correct, then why the Audacity Audio Editor can import is
> and display its info as: Signed 16-bit PCM, LE, Mono and SR of 44100 Hz?

That is either the default or it has a sophisticated algorithm to analyze
the data and best guess at the format.
> 3. What player can play such file?

SoX is one.
> 4. My goal with such raw audio files is to convert them to MP3. Could
> someone suggest how this is possible with Directshow?
Show full article (1.49Kb)
no comments
Re: Questions of RAW audio files         


Author: Alessandro Angeli
Date: Aug 26, 2008 09:26

From: "Chris P."
> You can write a custom source filter. You will need a
> custom interface to set the appropriate file properties
> so that your source filter can generate a valid media
> type. You can possibly use IAMStreamConfig instead of a
> custom interface. Beyond that the rest is trivial
> DirectShow, connect a MP3 compressor and a dump filter.
> If you want to add ID3 information you would also need a
> custom mux or writer (with the exception of ID3v1 which
> you can easily add after the fact).

In this case, it may be easier to just read the raw file
directly and feed it to an MP3 compressor, without involving
DirectShow.

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
no comments
Re: Questions of RAW audio files         


Author: dh
Date: Aug 26, 2008 13:19

"Alessandro Angeli" wrote:
> From: "Chris P."
>
>> You can write a custom source filter. You will need a
>> custom interface to set the appropriate file properties
>> so that your source filter can generate a valid media
>> type. You can possibly use IAMStreamConfig instead of a
>> custom interface. Beyond that the rest is trivial
>> DirectShow, connect a MP3 compressor and a dump filter.
>> If you want to add ID3 information you would also need a
>> custom mux or writer (with the exception of ID3v1 which
>> you can easily add after the fact).
>
> In this case, it may be easier to just read the raw file
> directly and feed it to an MP3 compressor, without involving
> DirectShow.
>

Thanks, Chris and Alessandro!
Show full article (1.12Kb)
no comments
Re: Questions of RAW audio files         


Author: Alessandro Angeli
Date: Aug 26, 2008 13:47

From: "dh"
> Alessandro, I'm interesting in your solution. However, I
> don't think you meant just read in a raw file byte by
> byte and dump it to a MP3 compressor, since the latter
> may not know how to parse the byte stream...

That is exactly what I meant: you tell the compressor what
the input format is (you need to somehow know, no compressor
I know of can guess the format of a PCM stream) and what
output format you want and you feed it blocks of PCM data,
getting blocks of MP3 data which you can simply dump to disk
(an MP3 file is a raw MP3 stream).
> Can you recommend a MP3 compressor for the above purpose?
Show full article (1.20Kb)
no comments