DSPRelated.com
Forums

Wave header format for mu-law and A-law

Started by Padmalatha Y August 27, 2003
Hi All,

Can any one tell me the wave header for mu-law and A-law. I have a wave
file which is mu-law 8-bit mono which has 56 bytes as header. I want to know in
what format are these bytes arranged. The following 56 byte header is provided
for reference.

52 49 46 46 6C 17 00 00 57 41 56 45 66 6D 74 20
12 00 00 00 07 00 01 00 40 1F 00 00 40 1F 00 00
01 00 08 00 00 00 66 61 63 74 04 00 00 00 E8 16
00 00 64 61 74 61 E8 16 00 00 Thanks in advance,
Padmalatha



Hello guys

Does anyone know how to upsample a speech wav file
from 8 khz to 16 khz

chifa98 =====
You may be disappointed if you fail BUT you are doomed if you dont try!!!!!

Till next time
Chipo



Chipo,
You can refer this link.
http://www.handhelds.org/z/wiki/UpSample
Best Regards,
Joseph QIAO
----------------------------
[x ] General Business Information
[] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
----------------------------

> -----Original Message-----
> From: Chipo Masawi [mailto:]
> Sent: Wednesday, August 27, 2003 11:12 PM
> To:
> Subject: [speechcoding] upsampling/zero padding > Hello guys
>
> Does anyone know how to upsample a speech wav file
> from 8 khz to 16 khz
>
> chifa98 > =====
> You may be disappointed if you fail BUT you are doomed if you
> dont try!!!!!
>
> Till next time
> Chipo >
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
> Printer at Myinks.com. Free s/h on orders $50 or more to the
> US & Canada. http://www.c1tracking.com/l.asp?cidU11
> http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GP4qlB/TM
> --------------------------
> -------~->
>
> _____________________________________
> Note: If you do a simple "reply" with your email client, only
> the author of this message will receive your answer. You
> need to do a "reply all" if you want your answer to be
> distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join:
>
> To Post:
>
> To Leave:
>
> Archives: http://www.yahoogroups.com/group/speechcoding
>
> Other DSP-Related Groups: http://www.dsprelated.com > ">http://docs.yahoo.com/info/terms/




Padmalatha,

You can refer to this link for wave format:

http://ccrma-www.stanford.edu/CCRMA/Courses/422/projects/WaveFormat/

Your wave file is formatted as follows:

Chunk Id = 'RIFF'
Chunk Size = 5996
Format = 'WAVE'

Subchunk Id = 'fmt '
Subchunk Size = 18
AudioFormat = 0x0007 (WAVE_FORMAT_MULAW)
NumChannels = 1
SampleRate = 8000
ByteRate = 8000
BlockAlign = 1
BitsPerSample = 8
ExtraParamLen = 2
ExtraParamVal = 0x0000

Subchunk Id = 'fact'
Subchunk Size = 4
Subchunk Val = 0xe8160000

Subchunk Id = 'data'
Subchunk Size = 5864

Regards,
/Shaofeng --- Padmalatha Y <> wrote:
> Hi All,
>
> Can any one tell me the wave header for
> mu-law and A-law. I have a wave file which is mu-law
> 8-bit mono which has 56 bytes as header. I want to
> know in what format are these bytes arranged. The
> following 56 byte header is provided for reference.
>
> 52 49 46 46 6C 17 00 00 57 41 56 45 66 6D 74 20
> 12 00 00 00 07 00 01 00 40 1F 00 00 40 1F 00 00
> 01 00 08 00 00 00 66 61 63 74 04 00 00 00 E8 16
> 00 00 64 61 74 61 E8 16 00 00 > Thanks in advance,
> Padmalatha >


__________________________________


On Wed, Aug 27, 2003 at 08:11:42AM -0700, Chipo Masawi wrote:
> Hello guys
>
> Does anyone know how to upsample a speech wav file
> from 8 khz to 16 khz
>
> chifa98
>

Chipo,

You can insert a zero sample between every sample, then low-pass filter at
fs/2 to remove the aliasing parts.

Or just use SoX. ( http://sox.sourceforge.net/ )

Regards,
Mark


Shaofeng-

FWIW, most .wav files are 44 byte header (e.g. Microsoft examples included with
WinXX) and don't have the 'fact' tag.

Jeff Brower
system engineer
Signalogic

Shaofeng Li wrote:
>
> Padmalatha,
>
> You can refer to this link for wave format:
>
> http://ccrma-www.stanford.edu/CCRMA/Courses/422/projects/WaveFormat/
>
> Your wave file is formatted as follows:
>
> Chunk Id = 'RIFF'
> Chunk Size = 5996
> Format = 'WAVE'
>
> Subchunk Id = 'fmt '
> Subchunk Size = 18
> AudioFormat = 0x0007 (WAVE_FORMAT_MULAW)
> NumChannels = 1
> SampleRate = 8000
> ByteRate = 8000
> BlockAlign = 1
> BitsPerSample = 8
> ExtraParamLen = 2
> ExtraParamVal = 0x0000
>
> Subchunk Id = 'fact'
> Subchunk Size = 4
> Subchunk Val = 0xe8160000
>
> Subchunk Id = 'data'
> Subchunk Size = 5864
>
> Regards,
> /Shaofeng
>
> --- Padmalatha Y <> wrote:
> > Hi All,
> >
> > Can any one tell me the wave header for
> > mu-law and A-law. I have a wave file which is mu-law
> > 8-bit mono which has 56 bytes as header. I want to
> > know in what format are these bytes arranged. The
> > following 56 byte header is provided for reference.
> >
> > 52 49 46 46 6C 17 00 00 57 41 56 45 66 6D 74 20
> > 12 00 00 00 07 00 01 00 40 1F 00 00 40 1F 00 00
> > 01 00 08 00 00 00 66 61 63 74 04 00 00 00 E8 16
> > 00 00 64 61 74 61 E8 16 00 00
> >
> >
> > Thanks in advance,
> > Padmalatha





On Thu, Aug 28, 2003 at 12:00:53PM -0500, Jeff Brower wrote:
> Shaofeng-
>
> FWIW, most .wav files are 44 byte header (e.g. Microsoft examples included
> with WinXX) and don't have the 'fact' tag.
>
> Jeff Brower
> system engineer
> Signalogic
>

This is why it's a good idea to use a library when you need to parse .wav
files. It's very easy to make wrong assumptions. If you only need to
write .wav's, then it's much easier.

Regards,
Mark


Mark-

> > Shaofeng-
> >
> > FWIW, most .wav files are 44 byte header (e.g. Microsoft examples included
with
> > WinXX) and don't have the 'fact' tag.
> >
> > Jeff Brower
> > system engineer
> > Signalogic
> >
>
> This is why it's a good idea to use a library when you need to parse .wav
> files. It's very easy to make wrong assumptions. If you only need to
> write .wav's, then it's much easier.

Absolutely, and the library code should fully understand the RIFF file format
and be
able to parse through multiple tags if necessary.

-Jeff


Jeff,

The 'fact' chunk is required for all compressed audio
formats, and for the case where the data is included
in 'wavl' list chunk.

In all cases, programs that reading wave files should
expect (and ignore)any unknown chunks encountered.

Regards,
/Shaofeng

--- Jeff Brower <> wrote:
> Shaofeng-
>
> FWIW, most .wav files are 44 byte header (e.g.
> Microsoft examples included with
> WinXX) and don't have the 'fact' tag.
>
> Jeff Brower
> system engineer
> Signalogic
>
> Shaofeng Li wrote:
> >
> > Padmalatha,
> >
> > You can refer to this link for wave format:
> >
> >
>
http://ccrma-www.stanford.edu/CCRMA/Courses/422/projects/WaveFormat/
> >
> > Your wave file is formatted as follows:
> >
> > Chunk Id = 'RIFF'
> > Chunk Size = 5996
> > Format = 'WAVE'
> >
> > Subchunk Id = 'fmt '
> > Subchunk Size = 18
> > AudioFormat = 0x0007 (WAVE_FORMAT_MULAW)
> > NumChannels = 1
> > SampleRate = 8000
> > ByteRate = 8000
> > BlockAlign = 1
> > BitsPerSample = 8
> > ExtraParamLen = 2
> > ExtraParamVal = 0x0000
> >
> > Subchunk Id = 'fact'
> > Subchunk Size = 4
> > Subchunk Val = 0xe8160000
> >
> > Subchunk Id = 'data'
> > Subchunk Size = 5864
> >
> > Regards,
> > /Shaofeng
> >
> > --- Padmalatha Y <> wrote:
> > > Hi All,
> > >
> > > Can any one tell me the wave header for
> > > mu-law and A-law. I have a wave file which is
> mu-law
> > > 8-bit mono which has 56 bytes as header. I want
> to
> > > know in what format are these bytes arranged.
> The
> > > following 56 byte header is provided for
> reference.
> > >
> > > 52 49 46 46 6C 17 00 00 57 41 56 45 66 6D 74 20
> > > 12 00 00 00 07 00 01 00 40 1F 00 00 40 1F 00 00
> > > 01 00 08 00 00 00 66 61 63 74 04 00 00 00 E8 16
> > > 00 00 64 61 74 61 E8 16 00 00
> > >
> > >
> > > Thanks in advance,
> > > Padmalatha


__________________________________



Shaofeng-

> The 'fact' chunk is required for all compressed audio
> formats, and for the case where the data is included
> in 'wavl' list chunk.

What kind of .wav files typically contain non-PCM data? Can you give some
typical examples? Do they still have .wav extensions, or some other
extensions?

Thanks.

-Jeff

> --- Jeff Brower <> wrote:
>> Shaofeng-
>>
>> FWIW, most .wav files are 44 byte header (e.g.
>> Microsoft examples included with
>> WinXX) and don't have the 'fact' tag.
>>
>> Jeff Brower
>> system engineer
>> Signalogic
>>
>> Shaofeng Li wrote:
>> >
>> > Padmalatha,
>> >
>> > You can refer to this link for wave format:
>> >
>> >
>>
> http://ccrma-www.stanford.edu/CCRMA/Courses/422/projects/WaveFormat/
>> >
>> > Your wave file is formatted as follows:
>> >
>> > Chunk Id = 'RIFF'
>> > Chunk Size = 5996
>> > Format = 'WAVE'
>> >
>> > Subchunk Id = 'fmt '
>> > Subchunk Size = 18
>> > AudioFormat = 0x0007 (WAVE_FORMAT_MULAW)
>> > NumChannels = 1
>> > SampleRate = 8000
>> > ByteRate = 8000
>> > BlockAlign = 1
>> > BitsPerSample = 8
>> > ExtraParamLen = 2
>> > ExtraParamVal = 0x0000
>> >
>> > Subchunk Id = 'fact'
>> > Subchunk Size = 4
>> > Subchunk Val = 0xe8160000
>> >
>> > Subchunk Id = 'data'
>> > Subchunk Size = 5864
>> >
>> > Regards,
>> > /Shaofeng
>> >
>> > --- Padmalatha Y <> wrote:
>> > > Hi All,
>> > >
>> > > Can any one tell me the wave header for
>> > > mu-law and A-law. I have a wave file which is
>> mu-law
>> > > 8-bit mono which has 56 bytes as header. I want
>> to
>> > > know in what format are these bytes arranged.
>> The
>> > > following 56 byte header is provided for
>> reference.
>> > >
>> > > 52 49 46 46 6C 17 00 00 57 41 56 45 66 6D 74 20
>> > > 12 00 00 00 07 00 01 00 40 1F 00 00 40 1F 00 00
>> > > 01 00 08 00 00 00 66 61 63 74 04 00 00 00 E8 16
>> > > 00 00 64 61 74 61 E8 16 00 00
>> > >
>> > >
>> > > Thanks in advance,
>> > > Padmalatha > __________________________________ >
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the author
> of this message will receive your answer. You need to do a "reply all" if
> you want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join:
>
> To Post:
>
> To Leave:
>
> Archives: http://www.yahoogroups.com/group/speechcoding
>
> Other DSP-Related Groups: http://www.dsprelated.com > ">http://docs.yahoo.com/info/terms/ >