SlideShare a Scribd company logo
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

BeepComp - Chiptune Creator - User's Guide (v0.2.2)
BeepComp - Chiptune Creator - User's Guide (v0.2.2)BeepComp - Chiptune Creator - User's Guide (v0.2.2)
BeepComp - Chiptune Creator - User's Guide (v0.2.2)
Hiro Morozumi
 
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
 
Production Reflection
Production ReflectionProduction Reflection
Production Reflection
GeorginaWhiteley1
 
Titling step by step
Titling step by stepTitling step by step
Titling step by step
JenniferEse
 
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 1
Martin 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 Organizations
DevOps.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 2
Martin 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.pdf
prajeetjain
 
Ikitmovie Animation Software Tutorial
Ikitmovie Animation Software TutorialIkitmovie Animation Software Tutorial
Ikitmovie Animation Software Tutorial
Adam Reilly
 
Work flow for adoboe primere element 9
Work flow for adoboe primere element 9Work flow for adoboe primere element 9
Work flow for adoboe primere element 9Nu Pro
 
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
DJ Johnny' O
 
Week 3 assignment
Week 3 assignmentWeek 3 assignment
Week 3 assignment
johnnys83
 
Media Technology- Premiere Skills
Media Technology- Premiere SkillsMedia Technology- Premiere Skills
Media Technology- Premiere Skills
atkia011
 

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

BeepComp - Chiptune Creator - User's Guide (v0.2.2)
BeepComp - Chiptune Creator - User's Guide (v0.2.2)BeepComp - Chiptune Creator - User's Guide (v0.2.2)
BeepComp - Chiptune Creator - User's Guide (v0.2.2)
 
Powerpoint
PowerpointPowerpoint
Powerpoint
 
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
 
Ikitmovie Animation Software Tutorial
Ikitmovie Animation Software TutorialIkitmovie Animation Software Tutorial
Ikitmovie Animation Software Tutorial
 
Work flow for adoboe primere element 9
Work flow for adoboe primere element 9Work flow for adoboe primere element 9
Work flow for adoboe primere element 9
 
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
 

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.pdf
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 
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
feelinggift
 

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

Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 

Recently uploaded (20)

Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 

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