0% found this document useful (0 votes)
4 views

Lab Assignment Multimedia Sample

Same as I included before

Uploaded by

Rinju Stha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lab Assignment Multimedia Sample

Same as I included before

Uploaded by

Rinju Stha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

TRIBHUVAN UNIVERSITY

Institute of Science & Technology

BHAKTAPUR MULTIPLE CAMPUS


Dudhpati-17, Bhaktapur

Lab Assignment of Multimedia Computing

Submitted By Submitted To:


Satya Sandesh Byanju Ms. Jina Chaudhary
6th Sem/BIT 2077 Bhaktapur Multiple Campus
Roll No.: 260 Signature: ………………

Date of Submission: 2081/04/


1. Audio
Software used: Wavepad
i. Insert any audio files
• Click on the “File” menu located at the top left corner of the WavePad Interface. Select
“Open” from the dropdown menu to import the audio file. Alternatively, we can directly
drag and drop the audio file.

1 Inserting Audio

ii. Try some effects (amplifying, Fade in, Fade out, Pitch and speed changes), Trim and cut
• Access the amplify tool by navigating to “Effects” in the menu bar and selecting “Amplify”
from the dropdown menu
• If necessary, select the portion of the audio you want to amplify by using the selection tool
• Adjust the amplification level using the provided slider or input field. Increase the
amplification level for a louder sound and decrease it for a softer sound.

2 Amplifying

1
To apply a fade in effect:
• Go to “Effects” in the menu bar.
• Select “Fade” from the dropdown menu.
• Choose “Fade in”.
• Adjust the duration of the fade in effect if necessary.
• Apply the effect by clicking “OK” or “Apply”.

3 Fade In
To apply a fade out effect:
• It’s the same two initial process as for fade in, and we choose “Fade Out”.
• Adjust the duration of the fade out effect if necessary.
• Apply the effect by clicking “OK” or “Apply”.

4 Fade Out

2
Adjusting Pitch:
• Go to “Effects” in the menu bar.
• Select “Pitch” from the dropdown menu.
• In the Pitch dialog box, you’ll see options to adjust pitch. You can increase or decrease the
pitch by adjusting the semitones or cents value. Positive values raise the pitch, while negative
value lower it.
• Apply the pitch adjustment by clicking “OK” or “Apply”.

5 Pitch

Changing Speed:

• Select the portion of the audio you want to adjust the speed for, if necessary, using the
selection tool.
• Go to “Effects” in the menu bar.
• Select “Time/Pitch” from the dropdown menu.
• In the Time/Pitch dialog box, you’ll see options to adjust the speed. You can increase or
decrease the speed by adjusting the percentage value. Increasing the percentage will speed up
the audio, while decreasing it will slow it down.
• Apply the speed adjustment by clicking “OK” or “Apply”.

6 Changing Speed

3
To trim the audio:
• Use the selection tool to highlight the section of the audio you want to keep.
• Go to “Edit” in the menu bar.
• Select “Trim” from the dropdown menu.
• The selected portion will be kept, and the rest will be removed.
To cut the audio into separate sections:
• Use the selection tool to highlight the section of the audio you want to cut.
• Go to “Edit” in the menu bar.
• Select “Cut” from the dropdown menu.
• The selected portion will be removed from the audio file.

7 Trim and cut

iii. Merge two different files, Mixing


To merge the audio files into a single file:
• Ensure that the audio files are aligned properly on the timeline.
• Go to “File” in the menu bar.
• Select “Save Mix As” or “Export Mix” from the dropdown menu.
• Choose the desired file format and location to save the merged audio file on the computer.
To mix the audio files together:
• Adjust the volume levels of each audio track to achieve the desired balance.
• Add effects, such as equalization, reverb or compression as required to enhance the mix.

8 Mixing

4
iv. Text to speech synthesizer
• Click on the “Tools” menu at the top of the WavePad interface.
• Select “Text to Speech” from the dropdown menu. This will open the Text to Speech dialog
box.
• In the dialog box, enter or paste the text you want to convert into speech into the provided
text field.
• Choose the desired voice from the available options.
• Click the “Synthesize Speech” button in the Text to Speech Synthesizer dialog box to
convert to speech.
• The converted speech will be inserted into WavePad project as a new audio track.

2. Video Editing
Software used: VideoPad
i. Take any video and crop it
• Click on the “Add Files” button in the toolbar or navigate to “File”>”Add Files” to import the
video file you want to crop into the VideoPad project.
• Drag and drop the imported video file from the media bin or file explorer onto the timeline.
• Click on the video clip on the timeline to select it. Then, navigate to the “Video Effects” tab in
the top toolbar.
• Find and click on the “Crop” button.
• Adjust the crop region that you prefer.
• Press “Enter” to apply crop effect to the video segment.

5
ii. Trim unwanted section
• Locate the section of the video you want to trim on the timeline.
• Click on the beginning of the section you want to trim to set the starting point.
• Click on the end of the section you want to trim to set the ending point.

iii. Add some text to be displayed there and add effects at the beginning of the video and end of
video.

3. Image
Software used: Adobe Photoshop
i. Implementing RGB values into HSV values.
• After opening the image, go to Image>Adjustment>Hue/Saturation, this will show the dialog
box containing sliders of Hue, Saturation and Lightness.
• Desired color can be selected using eyedropper and then Hue, Saturation and lightness can
be changed based on your preference.
• To save the adjustment, click “OK”.

6
4. COMPRESSION
i. Demonstrate RunLength compression in Python Programming Language.
Source Code:
def run_length_encoding(data):
if not data:
return ""
encoded_data = []
current_char = data[0]
count = 1
for char in data[1:]:
if char == current_char:
count += 1
else:
encoded_data.append(f"{current_char}{count}")
current_char = char
count = 1
encoded_data.append(f"{current_char}{count}")
return ''.join(encoded_data)
def run_length_decoding(encoded_data):
if not encoded_data:
return ""
decoded_data = []
count = ""
for char in encoded_data:
if char.isdigit():
count += char
else:
if count:
decoded_data.append(current_char * int(count))
current_char = char
count = ""
decoded_data.append(current_char * int(count))
return ''.join(decoded_data)
# Example usage
if __name__ == "__main__":
data = "aaabbbcccaaa"
print(f"Original Data: {data}")
encoded_data = run_length_encoding(data)
print(f"Encoded Data: {encoded_data}")
decoded_data = run_length_decoding(encoded_data)
print(f"Decoded Data: {decoded_data}")

Output:

7
5. Implementation of Huffman Coding
i. Huffman code implementation
Source Code:

import heapq
from collections import Counter
def huffman_encoding(data):
if not data:
return "", None
# Calculate frequency of each character
frequency = Counter(data)
# Create a priority queue (min-heap)
heap = [[weight, [char, ""]] for char, weight in frequency.items()]
heapq.heapify(heap)
# Build the Huffman tree
while len(heap) > 1:
lo = heapq.heappop(heap)
hi = heapq.heappop(heap)
for pair in lo[1:]:
pair[1] = '0' + pair[1]
for pair in hi[1:]:
pair[1] = '1' + pair[1]
heapq.heappush(heap, [lo[0] + hi[0]] + lo[1:] + hi[1:])
# Extract Huffman codes
huffman_codes = sorted(heapq.heappop(heap)[1:], key=lambda p: (len(p[-1]), p))
huffman_dict = {char: code for char, code in huffman_codes}
encoded_data = ''.join(huffman_dict[char] for char in data)
return encoded_data, huffman_dict
# Example usage
data = "aadderrtyygfhdddo"
encoded_data, huffman_dict = huffman_encoding(data)
print("Encoded data:", encoded_data)
print("Huffman Codes:", huffman_dict)

Output:

8
6. Animation
i. Write a program in C for bouncing ball animation using graphics.h header file
Source Code:
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
#include <dos.h>
int main() {
int gd = DETECT, gm;
int x, y, flag = 0;
initgraph(&gd, &gm, "C:\\TC\\BGI");
// Get mid positions in x and y-axis
x = getmaxx() / 2;
y = 30;

while (!kbhit()) {
if (y >= getmaxy() - 30 || y <= 30)
flag = !flag; // Reverse direction when hitting top or bottom
// Draw the red ball
setcolor(RED);
setfillstyle(SOLID_FILL, RED);
circle(x, y, 30);
floodfill(x, y, RED);
// Delay for 50 milliseconds
delay(50);
// Clear the screen
cleardevice();
if (flag) {
y += 5; // Move down
} else {
y -= 5; // Move up
}
}
getch();
closegraph();
return 0;
}

9
ii. Write a program in C for moving object animation.
Source code:
#include <conio.h>
#include <dos.h>
#include <graphics.h>
int main() {
int gd = DETECT, gm, i;
// Initialize graphics
initgraph(&gd, &gm, "C:\\TURBOC3\\BGI");
// Move the cycle
for (i = 0; i < 600; i++) {
// Upper body of cycle
line(50 + i, 405, 100 + i, 405);
line(75 + i, 375, 125 + i, 375);
line(50 + i, 405, 75 + i, 375);
line(100 + i, 405, 100 + i, 345);
line(150 + i, 405, 100 + i, 345);
line(75 + i, 345, 75 + i, 370);
line(70 + i, 370, 80 + i, 370);
line(80 + i, 345, 100 + i, 345);
// Wheels
circle(150 + i, 405, 30);
circle(50 + i, 405, 30);
// Road
line(0, 436, getmaxx(), 436);
// Stone (moving from right to left)
rectangle(getmaxx() - i, 436, 650 - i, 431);
// Delay for animation effect
delay(50);
cleardevice(); // Clear the screen
}
// Close graphics
closegraph();
return 0;
}

10
iii. Create timeline animations in Adobe Photoshop
Steps:
i. Firstly, an image is drawn or imported.
ii. The timeline is opened from the windows section from the top.
iii. Initial keyframe is set at the starting of the timeline.
iv. End keyframe is set applying different motion to the image.

iv. Create a timeline and tweening animations in Adobe Photoshop


Steps:
i. Initial key frame is set along with initial position of an object
ii. Second keyframe is set and the position of an object is changed along
iii. Another position is defined along with keyframe.
iv. The shape and size on final keyframe can also be changed to get zoomed effect
.
Before:

After:

11
v. Create Frame by Frame animation.
Steps:
i. Go to 'File>New' to create new document
ii. Set desired dimensions and resolution, then click 'Create'.
iii. Go to 'Window>Timeline' to open the Timeline panel
iv. Click drop-down arrow in the middle of Timeline panel and select 'Create Video
Timeline'
v. Add Video layer from Layer>Video Layers>New Blank Video Layer
vi. You can draw different shapes in each of the frame in the video layer
vii. There must be changes of shapes, position, opacity, sizes, so it looks like animation
viii. Frame rate can be changed from the menu in the Timeline Panel
ix. To review the animation, click play button on the Timeline
x. The animation can be exported using desired format.

vi. Create animation GIF in Adobe Photoshop.


Steps:
i. Import any image or we can follow same steps as we have created file for frame by
frame animation,
ii. At the top of Timeline panel, click the setting icon and select loop playback to make the
GIF loop continuously,
iii. Click the 'Play' button to preview the animation,
iv. For export, go to File > Export > Save for Web(Legacy),
v. Choose the number of colors(256 is standard),
vi. Click 'Save', choose a location and click 'Save' again.

12
vii. Create simple animated banners ads in Adobe photoshop

13

You might also like