Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Odd noise at start and end of a wave file

thokaskethokaske Posts: 3Member
Hi,

I am trying to write a program in Visual C++ that is supposed to play a wav file. It works fine except that it produces a crackling noise at the start and end. The file is OK (I used Winamp to verify that).
Does anyone have an idea what the problem might be

thx,
Thorsten

Comments

  • WEBMASTERWEBMASTER Posts: 549Member
    Perhaps the samplefile(.WAV) that you try to play has a header in front in the beginning of the file that your player tries to play and can't skip?


    [blue][italic][b]/WEBMASTER[/b][/italic][/blue]


  • thokaskethokaske Posts: 3Member
    The sample was recorded with a (very good) microphone.
    How can I find out if there is a header ?

  • WEBMASTERWEBMASTER Posts: 549Member
    IT all depends on the format of the sample-file that you try to play and what kind of format your player wants as input.

    You could always try to cut away the first for example 128 or 256 bytes of the file to see if it helps!

    You could also import the sample in a sample editor and save it as a RAW sample file to make sure that you don't have any header.




    [blue][italic][b]/WEBMASTER[/b][/italic][/blue]


  • Sephiroth2Sephiroth2 Posts: 423Member
    : Hi,
    :
    : I am trying to write a program in Visual C++ that is supposed to play a wav file. It works fine except that it produces a crackling noise at the start and end. The file is OK (I used Winamp to verify that).
    : Does anyone have an idea what the problem might be
    :
    : thx,
    : Thorsten
    :
    Not all of the WAV file is data that is to be played.
    The file begins with "RIFF"
    Then comes the length of the file. Then each chunk of the file comes. First there are 4 bytes to identify the chunk, and then, the length of the chunk comes.
    The relevant chunks are "fmt " (it is a WAVEFORMATEX structure) and "data" which contains the data.

  • membrucemembruce Posts: 5Member
    I have also seen this happen. The experience is from micro controllers and may not apply hear. When you start sending the wave the speaker is a 0 Volts and at rest. If either the baseline is not at 0 or you on a portion of the wave the speaker is suddenly set to this voltage. This produces a pop at the beginning. A similar effect can occur at the end of the play. Again, this may not apply hear but I thought it was worth mentioning.

    Good Luck
    Bruce


    : Hi,
    :
    : I am trying to write a program in Visual C++ that is supposed to play a wav file. It works fine except that it produces a crackling noise at the start and end. The file is OK (I used Winamp to verify that).
    : Does anyone have an idea what the problem might be
    :
    : thx,
    : Thorsten
    :


Sign In or Register to comment.