Converting 8-bit Wave file to 16-bit

Can someone give me a simple formula for converting an 8-bit wave file to 16-bit?



Thanks.


URL:http://www.geocities.com/Hodges_C

Comments

  • Hi!



    : Can someone give me a simple formula for converting an 8-bit wave file to 16-bit?



    Yep, sure I can. For each sample you read in, all you need to do is:



    1. Subtract 128 from the number.

    2. Multiply the result by 256.



    Then you can write the data back. Remember to read each byte in using the Byte data type and store the resulting data in a (short) integer. (E.G. a 16 Bit Integer).



    Hope This Helps - Feel free to email me if you get stuck!



    J. Worthington




    URL:http://www.jwcs.net/dap/

  • : Hi!

    :

    : : Can someone give me a simple formula for converting an 8-bit wave file to 16-bit?

    :

    : Yep, sure I can. For each sample you read in, all you need to do is:

    :

    : 1. Subtract 128 from the number.

    : 2. Multiply the result by 256.

    :

    : Then you can write the data back. Remember to read each byte in using the Byte data type and store the resulting data in a (short) integer. (E.G. a 16 Bit Integer).

    :

    : Hope This Helps - Feel free to email me if you get stuck!

    :

    : J. Worthington

    :

    :



    Worked great!!! Thanks.



    Chris




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories