Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7065215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:55:45+00:00 2026-05-28T04:55:45+00:00

Here is the problem: I have to change header of WAVE file, to be

  • 0

Here is the problem: I have to change header of WAVE file, to be exact I have to change ChunkSize and SubChunk2Size. The problem is that those values use 4bytes but it seemt that using fwrite i overwrite 8 bytes:

the original:

RIFFđ WAVEfmt

edited:

RIFF(}   }  fmt

code:

FILE *nova;
nova=fopen ( "nova.wav", "wb" );

fseek ( nova, 4, SEEK_SET );
fwrite ( &brojacC,4,1,nova );
fseek ( zvuk, 44, SEEK_SET );
fwrite ( &brojacCS2,4,1,nova );

In edited file WAVE is overwritten. Something went wrong because I started at 4th byte and wrote 4 bytes and WAVE starts at 8th byte.

I hope I was at least a bit clear. Can this be done in some other way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:55:46+00:00Added an answer on May 28, 2026 at 4:55 am

    Well, according to my man fopen output:

       r      Open  text  file  for  reading.  The stream is positioned at the
              beginning of the file.
    
       r+     Open for reading and writing.  The stream is positioned  at  the
              beginning of the file.
    
       w      Truncate  file  to  zero length or create text file for writing.
              The stream is positioned at the beginning of the file.
    
       w+     Open for reading and writing.  The file is created  if  it  does
              not  exist, otherwise it is truncated.  The stream is positioned
              at the beginning of the file.
    
       a      Open for appending (writing at end of file).  The file  is  cre‐
              ated  if it does not exist.  The stream is positioned at the end
              of the file.
    
       a+     Open for reading and appending (writing at end  of  file).   The
              file is created if it does not exist.  The initial file position
              for reading is at the beginning  of  the  file,  but  output  is
              always appended to the end of the file.
    

    That being said, I would definitely go forfopen("nova.wav", "r+b"), as w seems to truncate the file, and you’re reading before writing, while a appends to the end of the file, and you want to rewrite part of the file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the problem: I have two columns in a table that, for each
Here's my problem: I have an unmanaged dll that I made.I'm calling one of
Here is my problem. I have a ticket-tracking system that is not very 'user
I have a problem with NSTextField - that I can't change the text in
I have a problem with file uploading. I'm using that very method described in
I have a singleton here is the header file: #import <Foundation/Foundation.h> @interface Shared :
I have a simple problem: the WebGrid header doesn't change it's background color. Every
I have problem adding arraylist to list view, will explain about my problem here..
First, sorry for my bad english, I'm French. Here the problem : I have
Here's the problem: I have a data-bound list of items, basically a way for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.