Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A media clip is a short segment of electronic media, either an audio clip or a video clip. Media clips may be promotional in nature,

A media clip is a short segment of electronic media, either an audio clip or a video clip. Media clips may be promotional in nature, as with movie clips. Additionally, media clips may be raw materials of other productions, such as audio clips used for sound effects.

The fidelity of an audio clip is defined by the resolution (8, 16 or 24 bits per sample), the sampling rate (22050, 44100, or 88200 samples per second) and duration whereas, video clip is defined by number of frames per second, frame size and duration .

Audio codecs has one audio channel (mono) and two audio channels (stereo). For example, human voice is recorded using one channel while music uses in general two or more channels. The quality will vary depending on the bitrate, i.e. the number of bits used per unit of playback time.

Video codecs will contain a sequence of frames, i.e. still pictures and, for compressed formats, movements between those pictures. Quality will vary depending on the number of frames per second, resolution, etc.

Identify the number of classes and relation between them. In an object oriented programming language of your choice, write a definition for classes that contains:

  1. Fields for storing attributes with appropriate visibility;
  2. Setter and getter methods for manipulating these fields, such that the, resolution can only have values 8, 16 or 24, and sample Rate can only have values 22050, 44100 or 88200, frames per second must be greater than 25 and less than 30 and frame size should be 480, 720 and 960.
  3. A constructor that initializes new objects to have the lowest quality, resolution is set to 8, sample Rate is set to 22050, frames per second is set to be 25 and frame size to 480.
  4. A copy constructor

  • Write a new method called isStudioQuality that will return true or false, depending upon whether the clip stored has the maximum possible quality (i.e. 24-bit resolution, and a sample rate of 88200 samples per second, frames per second is to be 30 and frame size to 960).
  • Write a new method called dataSize that accepts the duration that an audio and video clip last in seconds (as an integer), and returns the number of bytes that this audio/video clip would occupy on disk or in memory.

The formula for calculating number of bytes b for audio clip, where is d duration (in seconds), c is channels, r is resolution (in bits), and s is sample rate, is:

b=d * c * (r/8) *s

And for video clip you need to sum the data size of each of these digital still images. It means that the total file size can be found as

file size = duration * frame per second * frame size

The file size is expressed in data size units, such as bytes, kilobytes, or megabytes..

In main create an object array of 10 media clips and test your code. Design a class diagram as well.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions