Questions tagged [lab4]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
178 views

Lab 4 Smiley - I can't change the color of pixels

#include "helpers.h" void colorize(int height, int width, RGBTRIPLE image[height][width]) { // Change all black pixels to a color of your choosing for (int i = 0; i < height; i++)...
Harr's user avatar
  • 35
0 votes
1 answer
79 views

Lab 4 using feof() function

I am getting problems with check50. My program differs from solution only in while condition, where I am using feof() function instead of fread(). feof() function returns a non-zero value when End-of-...
step00's user avatar
  • 3
0 votes
1 answer
159 views

Lab 4 volume understanding fopen() & fwrite()

in volume you have to fread() and fwrite() a wav file from an input to an output an alter the volume via a factor n. You first fwrite a header of size 44 bytes to a file output.wav with the help of an ...
Karl's user avatar
  • 5
0 votes
1 answer
33 views

Lab4 fread() and fwrite() problem

can anybody tell me what is wrong with this code block. When i use check50 it fails all three objectives. h_buffer: header buffer s_buffer: sample buffer // TODO: Copy header from input file to output ...
dohaal's user avatar
  • 1
1 vote
1 answer
38 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, ...
Vincent Xu's user avatar
1 vote
0 answers
103 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 ...
madmonkey's user avatar
0 votes
1 answer
136 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 ...
Tressa Sharma's user avatar
0 votes
1 answer
240 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, ...
Bhavik Khatri's user avatar
0 votes
1 answer
16 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.
Mohamed Hassan's user avatar
0 votes
2 answers
216 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[]) { // ...
shimurai's user avatar
0 votes
2 answers
277 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. ...
Lperino's user avatar
  • 14
1 vote
0 answers
86 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'...
Michelle's user avatar
0 votes
1 answer
177 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 '...
Cristian Estevez's user avatar
0 votes
2 answers
2k 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, ...
Marina Scalerandi's user avatar
0 votes
1 answer
233 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 ...
Aya Othman's user avatar