Questions tagged [lab4]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
21 views

Lab 4 - header vs &header

''' const int HEADER_SIZE = 44; uint8_t header[HEADER_SIZE]; // with & fread(&header, HEADER_SIZE, 1, input); fwrite(&header, HEADER_SIZE, 1, output); // without & fread(header, ...
user avatar
0 votes
0 answers
15 views

Lab 4 not altering output file - using solution word for word

I have looked at all the solutions here on the exchange. I have two issues. Firstly: const int HEADER_SIZE = 44; This does not work for me in the context of initializing a header array. I either have ...
user avatar
0 votes
1 answer
43 views

lab 4: volume question

I was wondering if someone could help explain why an while loop cannot be used for the copying of the header for the .wav file. I originally used a while loop like the one from the cp.c in the ...
user avatar
0 votes
1 answer
99 views

lab 4 is not passing check50, but the volume is changing by the factor when we listen to the audio

// Modifies the volume of an audio file #include <stdint.h> #include <stdio.h> #include <stdlib.h> // Number of bytes in .wav header const int HEADER_SIZE = 44; int main(int argc, ...
user avatar
0 votes
1 answer
10 views

unit16_t error while including library

Declaring Header is causing an error although <stdint.h> library is originally included in the distribution file, please help. Thanks in Advance.
user avatar
0 votes
2 answers
58 views

Lab 4 problems when the audio is clearly altered

Source file: #include <stdint.h> #include <stdio.h> #include <stdlib.h> // Number of bytes in .wav header const int HEADER_SIZE = 44; int main(int argc, char *argv[]) { // ...
user avatar
0 votes
1 answer
110 views

Why do you not need to allocate memory for int16_t in Lab4, volume?

Why, when setting up the buffer below, do you not need to use malloc to set aside memory for it? My code works fine, I just want to understand this a little better. Thanks, in advance, for the help. ...
user avatar
  • 14
0 votes
0 answers
58 views

Lab4 Volume, question about copying samples from input to output wave file

First of all, thank you for taking the time to read my question. I have actually completed Lab 4, Volume, and received full points on the assignment, however, there is one part of the code that I don'...
user avatar
0 votes
1 answer
76 views

Lab4 trouble multipliying int16_t types

I think i managed to copy the header successfully, but when trying to compile now that i wrote the rest of the code i get the following error: volume.c:51:19: error: assigning to 'int16_t *' (aka '...
user avatar
0 votes
2 answers
1k views

Problems with Lab4

everybody. I'm having problems with the Lab4 exercise. I've coded this for the TODO functions: // TODO: Copy header from input file to output file HEADER header; while (fread(&header, ...
user avatar
0 votes
1 answer
112 views

How can I know number of samples to add it as an argument for fread and fwrite?

I'm so confused about fread and fwrite. In lab 4 " Volume", how can I know the number of samples in the input wav file? i=I need to use fread(buffer , size , qty , file operator ). So how ...
user avatar