DEPARTMENT OF COMPUTING

CS 3005: Programming in C++

WAV File Output

Introduction

A WAV file is a file format that can be used to store sound data. It is actually a specific use of the RIFF file format. The WAV file consists of single RIFF chuck, that contains the “RIFF” header, a “fmt ” sub-chunk and a “data” sub-chunk. The “RIFF” header describes the file format, and the “fmt ” sub-chunk contains information about the audio format, such as the number of channels, and the “data” sub-chunk contains the actual audio data.

RIFF Header

The “RIFF” header has three pieces of information.

Assignment

In this assignment, you will start to create a class, WAVFile that supports the writing of WAV files.

Programming Requirements

Depends on the AudioTrack class.

Create library-audiofiles/endian_io.{h,cpp}

Declare the following functions in the header file, and implement them in the cpp file. Some of the functions belong to the little_endian_io namespace, and others to the big_endian_io namespace. Be sure to declare them correctly.

little_endian_io Functions:

big_endian_io Functions:

Create library-audiofiles/WAVFile.{h,cpp}

WAVFile Class

Data Members:

The WAVFile class should contain data members to track the following information. These data members should be protected or private. They are not allowed to be public.

public Methods:

Update library-audiofiles/Makefile

Additional Documentation

Grading Instructions

To receive credit for this assignment:

Extra Challenges (Not Required)

Describe possible additions and extensions that could be added without breaking the expected functionality. Careful not to give away too many possible exam tasks.

Last Updated 09/16/2024