16 bit PCM to wav file conversion

Discussion in 'Java' started by m rouch, Oct 7, 2003.

  1. m rouch

    m rouch Guest

    i am trying to convert a raw, uncompressed 16 bit PCM cut sampled at
    8000 samples/sec converted to a wav file. i was under the impression
    that all that was needed was to concat the cut onto a 44 byte wav file
    header with the correct parameters set, but when i put in all the
    parameters all i get is noise.

    when i set the samples/sec to 16000 and # bits to 8 in the wav header i
    get an ok cut, but there is a ton of noise compared with the original.
    (i used the same header sox gives in the conversion). am i missing some
    magical incantation?

    any help would be appreciated.

    -mike
    m rouch, Oct 7, 2003
    #1
    1. Advertising

  2. m rouch

    Will Clark Guest

    Just a stab in the dark... you have got the bytes ordered correctly in your
    16bit word? Try swapping the high and low bytes round and see if you get
    noise that way!

    "m rouch" <> wrote in message
    news:...
    > i am trying to convert a raw, uncompressed 16 bit PCM cut sampled at
    > 8000 samples/sec converted to a wav file. i was under the impression
    > that all that was needed was to concat the cut onto a 44 byte wav file
    > header with the correct parameters set, but when i put in all the
    > parameters all i get is noise.
    >
    > when i set the samples/sec to 16000 and # bits to 8 in the wav header i
    > get an ok cut, but there is a ton of noise compared with the original.
    > (i used the same header sox gives in the conversion). am i missing some
    > magical incantation?
    >
    > any help would be appreciated.
    >
    > -mike
    >
    Will Clark, Oct 7, 2003
    #2
    1. Advertising

  3. m rouch

    Roedy Green Guest

    On Tue, 7 Oct 2003 09:56:13 +0000 (UTC), "Will Clark"
    <> wrote or quoted
    :

    >Just a stab in the dark... you have got the bytes ordered correctly in your
    >16bit word? Try swapping the high and low bytes round and see if you get
    >noise that way!


    if that is the problem, see http://mindprod.com/jgloss/endian.html

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Oct 7, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. michael rouch

    16 bit PCM to wav conversion

    michael rouch, Oct 6, 2003, in forum: Java
    Replies:
    1
    Views:
    2,864
    Roedy Green
    Oct 6, 2003
  2. pcm format to wav...

    , Nov 28, 2005, in forum: Python
    Replies:
    1
    Views:
    334
    GIan Mario Tagliaretti
    Nov 28, 2005
  3. 525
    Replies:
    5
    Views:
    2,096
    Andrew Thompson
    Jun 29, 2008
  4. '2+
    Replies:
    2
    Views:
    476
  5. Roger Braun

    Playing raw PCM files in ruby

    Roger Braun, Aug 29, 2010, in forum: Ruby
    Replies:
    6
    Views:
    163
    yermej
    Aug 31, 2010
Loading...

Share This Page