SlideShare a Scribd company logo
1 of 3
Download to read offline
Below are some exercises to practice your skills with sound and image manipulation. Make a
new scenario for a (very simple) MP3 player. Create an actor for a start button. Place an MP3 file
into the scenario's sound folder. Program it so that clicking the button starts playing the MP3
file. Clicking it while it is playing stops playing the file. Make sure the button image changes: It
should be the typical "play" triangle while the sound is not playing, and change to the usual
"pause" symbol (double vertical bars) when it is playing. Add a stop button. This button should
stop the sound. When you then press play again, the sound starts from the beginning (not from
the point where it was stopped). Make sure the play button's image changes approximately when
the sound is stopped. Add two buttons to change the volume up and down. Add a display that
shows the current volume. Add three buttons to select three different songs (which you must
place in your sounds folder).
Solution
import java.applet.Applet;
example 10.45 and 10.47 :-
import java.applet.AudioClip;
import java.awt.Button;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class sound extends Applet implemets ActionListener{
Button play,stop;
AudioClip clip;
private static final string PLAY = "PLAY";
private static final string STOP = "STOP";
public void init()
{
play= new Button();
play.setLabel(PLAY);
play.setActionCommand(PLAY);
play.addActionListener(this);
add(play);
stop= new Button();
stop.setLabel(STOP);
stop.setActionCommand(STOP);
stop.addActionListener(this);
add(stop);
audioclip = getAudioclip(getcodebase() ,"one.mp3");
}
public void actionPerformed(ActionEvent e)
{
if(e.getActionCommand().equlas(PLAY))
{
audioClip.PLAY();
}
elseif((e.getActionCommand().equlas(STOP))
{
audioClip.STOP();
};
else{
audioClip.STOP();
}`
}
}
exercise 10.48 :
import java.Windows.Forms;
import java.Runtime.InteropServices;
public class form1 extends form{
private const int APPCOMMAND_VOLUME_MUTE=53422;
private const int APPCOMMAND_VOLUME_UP=52222;
private const int APPCOMMAND_VOLUME_DOWN=23422;
private const int WM_APPCOMMAND = 345;;
public static extern Intptr send messageW(IntPtr, int Msg , IntPtr, wPara , Intptr, lparam);
public form1() {
InitializeComponent();
}
private final void mute_CLICK(object sender, EventArgs e) {
Form1.SendMessage(this.Handle , WM_APPCOMMAND , this.Handle,
((IntPtr)(APPCOMMAND_VOLUME_MUTE)));
}
private final void decvol_CLICK(object sender, EventArgs e) {
Form1.SendMessage(this.Handle , WM_APPCOMMAND , this.Handle,
((IntPtr)(APPCOMMAND_VOLUME_MUTE)));
}
private final void incvol_CLICK(object sender, EventArgs e) {
Form1.SendMessage(this.Handle , WM_APPCOMMAND , this.Handle,
((IntPtr)(APPCOMMAND_VOLUME_MUTE)));
}
EXRECISE 10.49:
ADD A DISPLAY THAT SHOWS CURRENT VOLUME :-
import javax.sound.sampled.FloatControl;
protected FloatControl {
system.out.println("value is "+float getValue());
}
Exercise 10.46:- change image on pressing the button
import java.util.*;
public class changeimage extends japanel implements ActionListener{
private static string[] images lists{ //keep the path for images location// like
images/0ne.jpeg.....}
//extend the first example program but in action listener palce the following code:-
image=new ImageIcon("images lists[1]);
//implement the same code in play button also

More Related Content

Similar to Below are some exercises to practice your skills with sound and image.pdf

How To Create A Song Using Garage Band Without
How To Create A Song Using Garage Band Without How To Create A Song Using Garage Band Without
How To Create A Song Using Garage Band Without Luke
 
Post production (start)
Post production (start)Post production (start)
Post production (start)alexhughesss
 
Apple Garage Band
Apple Garage BandApple Garage Band
Apple Garage Bandjobb
 
Titling step by step
Titling step by stepTitling step by step
Titling step by stepJenniferEse
 
MusicEngine for Unity/ADX2LE(English)
MusicEngine for Unity/ADX2LE(English)MusicEngine for Unity/ADX2LE(English)
MusicEngine for Unity/ADX2LE(English)Sho Iwamoto
 
Digital Media Academy - Day 1
Digital Media Academy - Day 1Digital Media Academy - Day 1
Digital Media Academy - Day 1Martin Cisneros
 
Premiere Pro: Green screen
Premiere Pro: Green screen Premiere Pro: Green screen
Premiere Pro: Green screen KarlaDvorecka
 
Practicing Agile Accessibility in Large Organizations
Practicing Agile Accessibility in Large OrganizationsPracticing Agile Accessibility in Large Organizations
Practicing Agile Accessibility in Large OrganizationsDevOps.com
 
The sounds of Android (Android Makers 2018)
The sounds of Android (Android Makers 2018)The sounds of Android (Android Makers 2018)
The sounds of Android (Android Makers 2018)Yannick Lemin
 
Digital Media Academy - Day 2
Digital Media Academy - Day 2Digital Media Academy - Day 2
Digital Media Academy - Day 2Martin Cisneros
 
Need help with this java project, as the methods are proving to be p.pdf
Need help with this java project, as the methods are proving to be p.pdfNeed help with this java project, as the methods are proving to be p.pdf
Need help with this java project, as the methods are proving to be p.pdfprajeetjain
 
Nerve Slide Show 04 19 2009 97 03
Nerve Slide Show 04 19 2009      97 03Nerve Slide Show 04 19 2009      97 03
Nerve Slide Show 04 19 2009 97 03DJ Johnny' O
 
Week 3 assignment
Week 3 assignmentWeek 3 assignment
Week 3 assignmentjohnnys83
 
Media Technology- Premiere Skills
Media Technology- Premiere SkillsMedia Technology- Premiere Skills
Media Technology- Premiere Skillsatkia011
 
Lesson13 inserting sound
Lesson13   inserting soundLesson13   inserting sound
Lesson13 inserting soundguevarra_2000
 
Digital Media Academy Mac-Day2
Digital Media Academy Mac-Day2Digital Media Academy Mac-Day2
Digital Media Academy Mac-Day2Martin Cisneros
 
Wlmm stepby step
Wlmm stepby stepWlmm stepby step
Wlmm stepby stepthinkict
 
How to create stunning slideshows (PL)
How to create stunning slideshows (PL)How to create stunning slideshows (PL)
How to create stunning slideshows (PL)ictforteach
 

Similar to Below are some exercises to practice your skills with sound and image.pdf (20)

Editing log
Editing logEditing log
Editing log
 
How To Create A Song Using Garage Band Without
How To Create A Song Using Garage Band Without How To Create A Song Using Garage Band Without
How To Create A Song Using Garage Band Without
 
Post production (start)
Post production (start)Post production (start)
Post production (start)
 
Apple Garage Band
Apple Garage BandApple Garage Band
Apple Garage Band
 
Production Reflection
Production ReflectionProduction Reflection
Production Reflection
 
Titling step by step
Titling step by stepTitling step by step
Titling step by step
 
MusicEngine for Unity/ADX2LE(English)
MusicEngine for Unity/ADX2LE(English)MusicEngine for Unity/ADX2LE(English)
MusicEngine for Unity/ADX2LE(English)
 
Digital Media Academy - Day 1
Digital Media Academy - Day 1Digital Media Academy - Day 1
Digital Media Academy - Day 1
 
Premiere Pro: Green screen
Premiere Pro: Green screen Premiere Pro: Green screen
Premiere Pro: Green screen
 
Practicing Agile Accessibility in Large Organizations
Practicing Agile Accessibility in Large OrganizationsPracticing Agile Accessibility in Large Organizations
Practicing Agile Accessibility in Large Organizations
 
The sounds of Android (Android Makers 2018)
The sounds of Android (Android Makers 2018)The sounds of Android (Android Makers 2018)
The sounds of Android (Android Makers 2018)
 
Digital Media Academy - Day 2
Digital Media Academy - Day 2Digital Media Academy - Day 2
Digital Media Academy - Day 2
 
Need help with this java project, as the methods are proving to be p.pdf
Need help with this java project, as the methods are proving to be p.pdfNeed help with this java project, as the methods are proving to be p.pdf
Need help with this java project, as the methods are proving to be p.pdf
 
Nerve Slide Show 04 19 2009 97 03
Nerve Slide Show 04 19 2009      97 03Nerve Slide Show 04 19 2009      97 03
Nerve Slide Show 04 19 2009 97 03
 
Week 3 assignment
Week 3 assignmentWeek 3 assignment
Week 3 assignment
 
Media Technology- Premiere Skills
Media Technology- Premiere SkillsMedia Technology- Premiere Skills
Media Technology- Premiere Skills
 
Lesson13 inserting sound
Lesson13   inserting soundLesson13   inserting sound
Lesson13 inserting sound
 
Digital Media Academy Mac-Day2
Digital Media Academy Mac-Day2Digital Media Academy Mac-Day2
Digital Media Academy Mac-Day2
 
Wlmm stepby step
Wlmm stepby stepWlmm stepby step
Wlmm stepby step
 
How to create stunning slideshows (PL)
How to create stunning slideshows (PL)How to create stunning slideshows (PL)
How to create stunning slideshows (PL)
 

More from feelinggift

A) Which of the following element is seen in all organic molecules Si.pdf
A) Which of the following element is seen in all organic molecules Si.pdfA) Which of the following element is seen in all organic molecules Si.pdf
A) Which of the following element is seen in all organic molecules Si.pdffeelinggift
 
Given an ArrayList, write a Java method that returns a new ArrayList.pdf
Given an ArrayList, write a Java method that returns a new ArrayList.pdfGiven an ArrayList, write a Java method that returns a new ArrayList.pdf
Given an ArrayList, write a Java method that returns a new ArrayList.pdffeelinggift
 
Write an MSP430g2553 C program to drive a continually scrolling mess.pdf
Write an MSP430g2553 C program to drive a continually scrolling mess.pdfWrite an MSP430g2553 C program to drive a continually scrolling mess.pdf
Write an MSP430g2553 C program to drive a continually scrolling mess.pdffeelinggift
 
Which of the following is NOT a financial measurement needed to see .pdf
Which of the following is NOT a financial measurement needed to see .pdfWhich of the following is NOT a financial measurement needed to see .pdf
Which of the following is NOT a financial measurement needed to see .pdffeelinggift
 
Which process uses chemiosmosis A. Pyruvate oxidation B. Electron .pdf
Which process uses chemiosmosis  A. Pyruvate oxidation  B. Electron .pdfWhich process uses chemiosmosis  A. Pyruvate oxidation  B. Electron .pdf
Which process uses chemiosmosis A. Pyruvate oxidation B. Electron .pdffeelinggift
 
What motives do corporate executives have that force them to embrace.pdf
What motives do corporate executives have that force them to embrace.pdfWhat motives do corporate executives have that force them to embrace.pdf
What motives do corporate executives have that force them to embrace.pdffeelinggift
 
when are business cases or project charters overkillSolutionP.pdf
when are business cases or project charters overkillSolutionP.pdfwhen are business cases or project charters overkillSolutionP.pdf
when are business cases or project charters overkillSolutionP.pdffeelinggift
 
True or False The Congressional Budget Office projects that approxi.pdf
True or False The Congressional Budget Office projects that approxi.pdfTrue or False The Congressional Budget Office projects that approxi.pdf
True or False The Congressional Budget Office projects that approxi.pdffeelinggift
 
Using the space provided compose an ESSAY concerning the following qu.pdf
Using the space provided compose an ESSAY concerning the following qu.pdfUsing the space provided compose an ESSAY concerning the following qu.pdf
Using the space provided compose an ESSAY concerning the following qu.pdffeelinggift
 
We continually hear about interest groups in the news. Understanding.pdf
We continually hear about interest groups in the news. Understanding.pdfWe continually hear about interest groups in the news. Understanding.pdf
We continually hear about interest groups in the news. Understanding.pdffeelinggift
 
View transaction list Journal entry worksheet 6 9 The company receive.pdf
View transaction list Journal entry worksheet 6 9 The company receive.pdfView transaction list Journal entry worksheet 6 9 The company receive.pdf
View transaction list Journal entry worksheet 6 9 The company receive.pdffeelinggift
 
Physical security is a fundamental component of any secure infrastru.pdf
Physical security is a fundamental component of any secure infrastru.pdfPhysical security is a fundamental component of any secure infrastru.pdf
Physical security is a fundamental component of any secure infrastru.pdffeelinggift
 
TrueFalse Verilog is case-insensitive TF Verilog has constructs.pdf
TrueFalse Verilog is case-insensitive TF Verilog has constructs.pdfTrueFalse Verilog is case-insensitive TF Verilog has constructs.pdf
TrueFalse Verilog is case-insensitive TF Verilog has constructs.pdffeelinggift
 
This is a homework assignment that I have for my Java coding class. .pdf
This is a homework assignment that I have for my Java coding class. .pdfThis is a homework assignment that I have for my Java coding class. .pdf
This is a homework assignment that I have for my Java coding class. .pdffeelinggift
 
The Jannuschs operated Festival Foods, a busi- ness that served conc.pdf
The Jannuschs operated Festival Foods, a busi- ness that served conc.pdfThe Jannuschs operated Festival Foods, a busi- ness that served conc.pdf
The Jannuschs operated Festival Foods, a busi- ness that served conc.pdffeelinggift
 
The first thermodynamic law for a system of charged molecules in elec.pdf
The first thermodynamic law for a system of charged molecules in elec.pdfThe first thermodynamic law for a system of charged molecules in elec.pdf
The first thermodynamic law for a system of charged molecules in elec.pdffeelinggift
 
show all of your work to arrive a final result Simple Interest Simpl.pdf
show all of your work to arrive a final result Simple Interest Simpl.pdfshow all of your work to arrive a final result Simple Interest Simpl.pdf
show all of your work to arrive a final result Simple Interest Simpl.pdffeelinggift
 
Terms from which students can chooseMacrophages; •Only one.pdf
Terms from which students can chooseMacrophages; •Only one.pdfTerms from which students can chooseMacrophages; •Only one.pdf
Terms from which students can chooseMacrophages; •Only one.pdffeelinggift
 
Simulate the Stakeholder deliverable for the development of an onlin.pdf
Simulate the Stakeholder deliverable for the development of an onlin.pdfSimulate the Stakeholder deliverable for the development of an onlin.pdf
Simulate the Stakeholder deliverable for the development of an onlin.pdffeelinggift
 
I want to write this program in java.Write a simple airline ticket.pdf
I want to write this program in java.Write a simple airline ticket.pdfI want to write this program in java.Write a simple airline ticket.pdf
I want to write this program in java.Write a simple airline ticket.pdffeelinggift
 

More from feelinggift (20)

A) Which of the following element is seen in all organic molecules Si.pdf
A) Which of the following element is seen in all organic molecules Si.pdfA) Which of the following element is seen in all organic molecules Si.pdf
A) Which of the following element is seen in all organic molecules Si.pdf
 
Given an ArrayList, write a Java method that returns a new ArrayList.pdf
Given an ArrayList, write a Java method that returns a new ArrayList.pdfGiven an ArrayList, write a Java method that returns a new ArrayList.pdf
Given an ArrayList, write a Java method that returns a new ArrayList.pdf
 
Write an MSP430g2553 C program to drive a continually scrolling mess.pdf
Write an MSP430g2553 C program to drive a continually scrolling mess.pdfWrite an MSP430g2553 C program to drive a continually scrolling mess.pdf
Write an MSP430g2553 C program to drive a continually scrolling mess.pdf
 
Which of the following is NOT a financial measurement needed to see .pdf
Which of the following is NOT a financial measurement needed to see .pdfWhich of the following is NOT a financial measurement needed to see .pdf
Which of the following is NOT a financial measurement needed to see .pdf
 
Which process uses chemiosmosis A. Pyruvate oxidation B. Electron .pdf
Which process uses chemiosmosis  A. Pyruvate oxidation  B. Electron .pdfWhich process uses chemiosmosis  A. Pyruvate oxidation  B. Electron .pdf
Which process uses chemiosmosis A. Pyruvate oxidation B. Electron .pdf
 
What motives do corporate executives have that force them to embrace.pdf
What motives do corporate executives have that force them to embrace.pdfWhat motives do corporate executives have that force them to embrace.pdf
What motives do corporate executives have that force them to embrace.pdf
 
when are business cases or project charters overkillSolutionP.pdf
when are business cases or project charters overkillSolutionP.pdfwhen are business cases or project charters overkillSolutionP.pdf
when are business cases or project charters overkillSolutionP.pdf
 
True or False The Congressional Budget Office projects that approxi.pdf
True or False The Congressional Budget Office projects that approxi.pdfTrue or False The Congressional Budget Office projects that approxi.pdf
True or False The Congressional Budget Office projects that approxi.pdf
 
Using the space provided compose an ESSAY concerning the following qu.pdf
Using the space provided compose an ESSAY concerning the following qu.pdfUsing the space provided compose an ESSAY concerning the following qu.pdf
Using the space provided compose an ESSAY concerning the following qu.pdf
 
We continually hear about interest groups in the news. Understanding.pdf
We continually hear about interest groups in the news. Understanding.pdfWe continually hear about interest groups in the news. Understanding.pdf
We continually hear about interest groups in the news. Understanding.pdf
 
View transaction list Journal entry worksheet 6 9 The company receive.pdf
View transaction list Journal entry worksheet 6 9 The company receive.pdfView transaction list Journal entry worksheet 6 9 The company receive.pdf
View transaction list Journal entry worksheet 6 9 The company receive.pdf
 
Physical security is a fundamental component of any secure infrastru.pdf
Physical security is a fundamental component of any secure infrastru.pdfPhysical security is a fundamental component of any secure infrastru.pdf
Physical security is a fundamental component of any secure infrastru.pdf
 
TrueFalse Verilog is case-insensitive TF Verilog has constructs.pdf
TrueFalse Verilog is case-insensitive TF Verilog has constructs.pdfTrueFalse Verilog is case-insensitive TF Verilog has constructs.pdf
TrueFalse Verilog is case-insensitive TF Verilog has constructs.pdf
 
This is a homework assignment that I have for my Java coding class. .pdf
This is a homework assignment that I have for my Java coding class. .pdfThis is a homework assignment that I have for my Java coding class. .pdf
This is a homework assignment that I have for my Java coding class. .pdf
 
The Jannuschs operated Festival Foods, a busi- ness that served conc.pdf
The Jannuschs operated Festival Foods, a busi- ness that served conc.pdfThe Jannuschs operated Festival Foods, a busi- ness that served conc.pdf
The Jannuschs operated Festival Foods, a busi- ness that served conc.pdf
 
The first thermodynamic law for a system of charged molecules in elec.pdf
The first thermodynamic law for a system of charged molecules in elec.pdfThe first thermodynamic law for a system of charged molecules in elec.pdf
The first thermodynamic law for a system of charged molecules in elec.pdf
 
show all of your work to arrive a final result Simple Interest Simpl.pdf
show all of your work to arrive a final result Simple Interest Simpl.pdfshow all of your work to arrive a final result Simple Interest Simpl.pdf
show all of your work to arrive a final result Simple Interest Simpl.pdf
 
Terms from which students can chooseMacrophages; •Only one.pdf
Terms from which students can chooseMacrophages; •Only one.pdfTerms from which students can chooseMacrophages; •Only one.pdf
Terms from which students can chooseMacrophages; •Only one.pdf
 
Simulate the Stakeholder deliverable for the development of an onlin.pdf
Simulate the Stakeholder deliverable for the development of an onlin.pdfSimulate the Stakeholder deliverable for the development of an onlin.pdf
Simulate the Stakeholder deliverable for the development of an onlin.pdf
 
I want to write this program in java.Write a simple airline ticket.pdf
I want to write this program in java.Write a simple airline ticket.pdfI want to write this program in java.Write a simple airline ticket.pdf
I want to write this program in java.Write a simple airline ticket.pdf
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint23600690
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17Celine George
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMELOISARIVERA8
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 

Recently uploaded (20)

Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 

Below are some exercises to practice your skills with sound and image.pdf

  • 1. Below are some exercises to practice your skills with sound and image manipulation. Make a new scenario for a (very simple) MP3 player. Create an actor for a start button. Place an MP3 file into the scenario's sound folder. Program it so that clicking the button starts playing the MP3 file. Clicking it while it is playing stops playing the file. Make sure the button image changes: It should be the typical "play" triangle while the sound is not playing, and change to the usual "pause" symbol (double vertical bars) when it is playing. Add a stop button. This button should stop the sound. When you then press play again, the sound starts from the beginning (not from the point where it was stopped). Make sure the play button's image changes approximately when the sound is stopped. Add two buttons to change the volume up and down. Add a display that shows the current volume. Add three buttons to select three different songs (which you must place in your sounds folder). Solution import java.applet.Applet; example 10.45 and 10.47 :- import java.applet.AudioClip; import java.awt.Button; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class sound extends Applet implemets ActionListener{ Button play,stop; AudioClip clip; private static final string PLAY = "PLAY"; private static final string STOP = "STOP"; public void init() { play= new Button(); play.setLabel(PLAY); play.setActionCommand(PLAY); play.addActionListener(this); add(play); stop= new Button(); stop.setLabel(STOP); stop.setActionCommand(STOP); stop.addActionListener(this);
  • 2. add(stop); audioclip = getAudioclip(getcodebase() ,"one.mp3"); } public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equlas(PLAY)) { audioClip.PLAY(); } elseif((e.getActionCommand().equlas(STOP)) { audioClip.STOP(); }; else{ audioClip.STOP(); }` } } exercise 10.48 : import java.Windows.Forms; import java.Runtime.InteropServices; public class form1 extends form{ private const int APPCOMMAND_VOLUME_MUTE=53422; private const int APPCOMMAND_VOLUME_UP=52222; private const int APPCOMMAND_VOLUME_DOWN=23422; private const int WM_APPCOMMAND = 345;; public static extern Intptr send messageW(IntPtr, int Msg , IntPtr, wPara , Intptr, lparam); public form1() { InitializeComponent(); } private final void mute_CLICK(object sender, EventArgs e) { Form1.SendMessage(this.Handle , WM_APPCOMMAND , this.Handle, ((IntPtr)(APPCOMMAND_VOLUME_MUTE))); } private final void decvol_CLICK(object sender, EventArgs e) { Form1.SendMessage(this.Handle , WM_APPCOMMAND , this.Handle,
  • 3. ((IntPtr)(APPCOMMAND_VOLUME_MUTE))); } private final void incvol_CLICK(object sender, EventArgs e) { Form1.SendMessage(this.Handle , WM_APPCOMMAND , this.Handle, ((IntPtr)(APPCOMMAND_VOLUME_MUTE))); } EXRECISE 10.49: ADD A DISPLAY THAT SHOWS CURRENT VOLUME :- import javax.sound.sampled.FloatControl; protected FloatControl { system.out.println("value is "+float getValue()); } Exercise 10.46:- change image on pressing the button import java.util.*; public class changeimage extends japanel implements ActionListener{ private static string[] images lists{ //keep the path for images location// like images/0ne.jpeg.....} //extend the first example program but in action listener palce the following code:- image=new ImageIcon("images lists[1]); //implement the same code in play button also