SlideShare a Scribd company logo
Visual Studio C++ OOP
I need to complete the program about how to play a WAV file in stereo.
the program seems to play the WAV file in mono since it has a bad sound quality.
chegg can't upload the WAV file, so I need you to use your own WAV file.
#include
#include
#include "CAudio.h"
#include "conio.h"
typedef struct wav_header {
// RIFF Header
char riff_header[4]; // Contains "RIFF"
int wav_size; // Size of the wav portion of the file, which follows the first 8 bytes. File size - 8
char wave_header[4]; // Contains "WAVE"
// Format Header
char fmt_header[4]; // Contains "fmt " (includes trailing space)
int fmt_chunk_size; // Should be 16 for PCM
short audio_format; // Should be 1 for PCM. 3 for IEEE Float
short num_channels;
int sample_rate;
int byte_rate; // Number of bytes per second. sample_rate * num_channels * Bytes Per
Sample
short sample_alignment; // num_channels * Bytes Per Sample
short bit_depth; // Number of bits per sample
// Data
char data_header[4]; // Contains "data"
int data_bytes; // Number of bytes in data. Number of samples * num_channels * sample byte
size
// uint8_t bytes[]; // Remainder of wave file is bytes
} wav_header;
CAudio *lp;
FILE *In;
int g_No = 0;
void CALLBACK Play_Proc(HWAVEOUT hWaveOut, UINT uMsg, DWORD dwInstance,
DWORD dwParam1, DWORD dwParam2)
{ int Len=160;
short Speech[160];
switch (uMsg)
{ case WOM_DONE:
if (lp->PStart)
{ if (In!=NULL) fread(Speech, 2, 160, In); // 160 Sample Data
if (feof(In)) fseek(In, 0, 0);
lp->Play_Speech(Speech, Len);
g_No += Len; printf("%dr", g_No++);
}
break;
}
}
int main()
{
lp = new CAudio();
// 2.Play WAV File
errno_t err;
wav_header Buf;
//if ((err = fopen_s(&In, "Speech.wav", "rb")) != 0) { printf("File Errorn"); return 0; }
if ((err = fopen_s(&In, "file_example_WAV_1MG.wav", "rb")) != 0) { printf("File Errorn");
return 0; }
//if ((err = fopen_s(&In, "guitartune.wav", "rb")) != 0) { printf("File Errorn"); return 0; }
//if ((err = fopen_s(&In, "rbds_capture_47500.wav", "rb")) != 0) { printf("File Errorn");
return 0; }
fread(&Buf, 1, sizeof(wav_header), In);
printf("Sample Rate=%dn", Buf.sample_rate);
printf("Channel =%dn", Buf.num_channels);
printf("Bits/Sample=%dn", Buf.bit_depth);
// 2.5
lp->Init_Audio(160, -1, -1, Buf.sample_rate);
lp->Open_Play((DWORD)Play_Proc, CALLBACK_FUNCTION);
lp->Start_Play();
//3.Play WAV File
char c = _getch();
// 4.
lp->Stop_Play();
lp->Close_Play();
// 5.
fclose(In); In = NULL;
}

More Related Content

Similar to Visual Studio C++ OOP I need to complete the program about how to .pdf

file_handling_in_c.ppt
file_handling_in_c.pptfile_handling_in_c.ppt
file_handling_in_c.ppt
yuvrajkeshri
 
What Shazam doesn't want you to know
What Shazam doesn't want you to knowWhat Shazam doesn't want you to know
What Shazam doesn't want you to know
Roy van Rijn
 
Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014
Chris Adamson
 
Mp3 Encoding Core Implementation
Mp3 Encoding Core ImplementationMp3 Encoding Core Implementation
Mp3 Encoding Core Implementation
Willow Cheng
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
RashidFaridChishti
 
Cell processor lab
Cell processor labCell processor lab
Cell processor lab
coolmirza143
 
Introductory Lecture to Audio Signal Processing
Introductory Lecture to Audio Signal ProcessingIntroductory Lecture to Audio Signal Processing
Introductory Lecture to Audio Signal Processing
Angelo Salatino
 
Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Chris Adamson
 
file_handling_in_c.ppt
file_handling_in_c.pptfile_handling_in_c.ppt
file_handling_in_c.ppt
DHARUNESHBOOPATHY
 
Moving Pictures - Web 2.0 Expo NYC
Moving Pictures - Web 2.0 Expo NYCMoving Pictures - Web 2.0 Expo NYC
Moving Pictures - Web 2.0 Expo NYCCal Henderson
 
Getting started with SIP Express Media Server SIP app server and SBC - workshop
Getting started with SIP Express Media Server SIP app server and SBC - workshopGetting started with SIP Express Media Server SIP app server and SBC - workshop
Getting started with SIP Express Media Server SIP app server and SBC - workshop
stefansayer
 
Module 03 File Handling in C
Module 03 File Handling in CModule 03 File Handling in C
Module 03 File Handling in C
Tushar B Kute
 
TffffThe program needs to be in C++ and part 1 of the assignment i.pdf
TffffThe program needs to be in C++ and part 1 of the assignment i.pdfTffffThe program needs to be in C++ and part 1 of the assignment i.pdf
TffffThe program needs to be in C++ and part 1 of the assignment i.pdf
arri2009av
 
Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)
Chris Adamson
 
sounds in bada
sounds in badasounds in bada
sounds in bada
Samsung
 
Vietnam Mobile Day 2013: Multimedia FFMPEG
Vietnam Mobile Day 2013: Multimedia FFMPEGVietnam Mobile Day 2013: Multimedia FFMPEG
Vietnam Mobile Day 2013: Multimedia FFMPEG
GameLandVN
 
[Vietnam Mobile Day 2013] - Giới thiệu android media framework dựa trên công ...
[Vietnam Mobile Day 2013] - Giới thiệu android media framework dựa trên công ...[Vietnam Mobile Day 2013] - Giới thiệu android media framework dựa trên công ...
[Vietnam Mobile Day 2013] - Giới thiệu android media framework dựa trên công ...
AiTi Education
 
Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O
YourHelper1
 

Similar to Visual Studio C++ OOP I need to complete the program about how to .pdf (20)

file_handling_in_c.ppt
file_handling_in_c.pptfile_handling_in_c.ppt
file_handling_in_c.ppt
 
What Shazam doesn't want you to know
What Shazam doesn't want you to knowWhat Shazam doesn't want you to know
What Shazam doesn't want you to know
 
Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014
 
Mp3 Encoding Core Implementation
Mp3 Encoding Core ImplementationMp3 Encoding Core Implementation
Mp3 Encoding Core Implementation
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
Cell processor lab
Cell processor labCell processor lab
Cell processor lab
 
Introductory Lecture to Audio Signal Processing
Introductory Lecture to Audio Signal ProcessingIntroductory Lecture to Audio Signal Processing
Introductory Lecture to Audio Signal Processing
 
Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)
 
file_handling_in_c.ppt
file_handling_in_c.pptfile_handling_in_c.ppt
file_handling_in_c.ppt
 
Moving Pictures - Web 2.0 Expo NYC
Moving Pictures - Web 2.0 Expo NYCMoving Pictures - Web 2.0 Expo NYC
Moving Pictures - Web 2.0 Expo NYC
 
Getting started with SIP Express Media Server SIP app server and SBC - workshop
Getting started with SIP Express Media Server SIP app server and SBC - workshopGetting started with SIP Express Media Server SIP app server and SBC - workshop
Getting started with SIP Express Media Server SIP app server and SBC - workshop
 
Module 03 File Handling in C
Module 03 File Handling in CModule 03 File Handling in C
Module 03 File Handling in C
 
TffffThe program needs to be in C++ and part 1 of the assignment i.pdf
TffffThe program needs to be in C++ and part 1 of the assignment i.pdfTffffThe program needs to be in C++ and part 1 of the assignment i.pdf
TffffThe program needs to be in C++ and part 1 of the assignment i.pdf
 
Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)
 
sounds in bada
sounds in badasounds in bada
sounds in bada
 
FFmpeg
FFmpegFFmpeg
FFmpeg
 
Vietnam Mobile Day 2013: Multimedia FFMPEG
Vietnam Mobile Day 2013: Multimedia FFMPEGVietnam Mobile Day 2013: Multimedia FFMPEG
Vietnam Mobile Day 2013: Multimedia FFMPEG
 
[Vietnam Mobile Day 2013] - Giới thiệu android media framework dựa trên công ...
[Vietnam Mobile Day 2013] - Giới thiệu android media framework dựa trên công ...[Vietnam Mobile Day 2013] - Giới thiệu android media framework dựa trên công ...
[Vietnam Mobile Day 2013] - Giới thiệu android media framework dựa trên công ...
 
Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O
 
Satz1
Satz1Satz1
Satz1
 

More from amanbag

Using ASP.NET create a page to play Rock Paper and Scissors agains.pdf
Using ASP.NET create a page to play Rock Paper and Scissors agains.pdfUsing ASP.NET create a page to play Rock Paper and Scissors agains.pdf
Using ASP.NET create a page to play Rock Paper and Scissors agains.pdf
amanbag
 
Use the template that is linked HERE for DTL 16. 1) Draw chro.pdf
Use the template that is linked HERE for DTL 16.      1) Draw chro.pdfUse the template that is linked HERE for DTL 16.      1) Draw chro.pdf
Use the template that is linked HERE for DTL 16. 1) Draw chro.pdf
amanbag
 
What is the future value in three years of $1,000 invested in an acc.pdf
What is the future value in three years of $1,000 invested in an acc.pdfWhat is the future value in three years of $1,000 invested in an acc.pdf
What is the future value in three years of $1,000 invested in an acc.pdf
amanbag
 
Using SSMS create a database using an ERD diagram with the following.pdf
Using SSMS create a database using an ERD diagram with the following.pdfUsing SSMS create a database using an ERD diagram with the following.pdf
Using SSMS create a database using an ERD diagram with the following.pdf
amanbag
 
What is the difference between the greenhouse effect and ozone deple.pdf
What is the difference between the greenhouse effect and ozone deple.pdfWhat is the difference between the greenhouse effect and ozone deple.pdf
What is the difference between the greenhouse effect and ozone deple.pdf
amanbag
 
What is the difference between a primary and secondary follicle a.pdf
What is the difference between a primary and secondary follicle a.pdfWhat is the difference between a primary and secondary follicle a.pdf
What is the difference between a primary and secondary follicle a.pdf
amanbag
 
What is the deadweight loss Use the following scenario for question.pdf
What is the deadweight loss Use the following scenario for question.pdfWhat is the deadweight loss Use the following scenario for question.pdf
What is the deadweight loss Use the following scenario for question.pdf
amanbag
 
What is one way that gene flow can constrainslow down evolution by .pdf
What is one way that gene flow can constrainslow down evolution by .pdfWhat is one way that gene flow can constrainslow down evolution by .pdf
What is one way that gene flow can constrainslow down evolution by .pdf
amanbag
 
What is Property Management System (PMS) Choose Opera PMS and bring.pdf
What is Property Management System (PMS) Choose Opera PMS and bring.pdfWhat is Property Management System (PMS) Choose Opera PMS and bring.pdf
What is Property Management System (PMS) Choose Opera PMS and bring.pdf
amanbag
 
What is the correct definition of the term �relative price� 1.The r.pdf
What is the correct definition of the term �relative price� 1.The r.pdfWhat is the correct definition of the term �relative price� 1.The r.pdf
What is the correct definition of the term �relative price� 1.The r.pdf
amanbag
 
What is meant by demonstrating capability Question 17 options 1) G.pdf
What is meant by demonstrating capability Question 17 options 1) G.pdfWhat is meant by demonstrating capability Question 17 options 1) G.pdf
What is meant by demonstrating capability Question 17 options 1) G.pdf
amanbag
 
What is left in the process Terrestrial Inorganic Carbon Cycle Atmo.pdf
What is left in the process Terrestrial Inorganic Carbon Cycle Atmo.pdfWhat is left in the process Terrestrial Inorganic Carbon Cycle Atmo.pdf
What is left in the process Terrestrial Inorganic Carbon Cycle Atmo.pdf
amanbag
 
What is climate change Why do scientists believe that this is a hum.pdf
What is climate change Why do scientists believe that this is a hum.pdfWhat is climate change Why do scientists believe that this is a hum.pdf
What is climate change Why do scientists believe that this is a hum.pdf
amanbag
 
What Is Basic Text Functions In Python What was most rewarding fo.pdf
What Is Basic Text Functions In Python   What was most rewarding fo.pdfWhat Is Basic Text Functions In Python   What was most rewarding fo.pdf
What Is Basic Text Functions In Python What was most rewarding fo.pdf
amanbag
 
What is a major benefit of using prototypes that solve a core custom.pdf
What is a major benefit of using prototypes that solve a core custom.pdfWhat is a major benefit of using prototypes that solve a core custom.pdf
What is a major benefit of using prototypes that solve a core custom.pdf
amanbag
 
What is data integrity What are the sources of data in healthcare .pdf
What is data integrity What are the sources of data in healthcare .pdfWhat is data integrity What are the sources of data in healthcare .pdf
What is data integrity What are the sources of data in healthcare .pdf
amanbag
 
What is a difference between skeletal and cardiac muscleA. Each m.pdf
What is a difference between skeletal and cardiac muscleA. Each m.pdfWhat is a difference between skeletal and cardiac muscleA. Each m.pdf
What is a difference between skeletal and cardiac muscleA. Each m.pdf
amanbag
 
Use this information to answer questions 19-20Full-blown sickle c.pdf
Use this information to answer questions 19-20Full-blown sickle c.pdfUse this information to answer questions 19-20Full-blown sickle c.pdf
Use this information to answer questions 19-20Full-blown sickle c.pdf
amanbag
 
What does the First Law of Thermodynamics state Question 2 options.pdf
What does the First Law of Thermodynamics state Question 2 options.pdfWhat does the First Law of Thermodynamics state Question 2 options.pdf
What does the First Law of Thermodynamics state Question 2 options.pdf
amanbag
 
What is a financing costA. Any interest or dividends included as .pdf
What is a financing costA. Any interest or dividends included as .pdfWhat is a financing costA. Any interest or dividends included as .pdf
What is a financing costA. Any interest or dividends included as .pdf
amanbag
 

More from amanbag (20)

Using ASP.NET create a page to play Rock Paper and Scissors agains.pdf
Using ASP.NET create a page to play Rock Paper and Scissors agains.pdfUsing ASP.NET create a page to play Rock Paper and Scissors agains.pdf
Using ASP.NET create a page to play Rock Paper and Scissors agains.pdf
 
Use the template that is linked HERE for DTL 16. 1) Draw chro.pdf
Use the template that is linked HERE for DTL 16.      1) Draw chro.pdfUse the template that is linked HERE for DTL 16.      1) Draw chro.pdf
Use the template that is linked HERE for DTL 16. 1) Draw chro.pdf
 
What is the future value in three years of $1,000 invested in an acc.pdf
What is the future value in three years of $1,000 invested in an acc.pdfWhat is the future value in three years of $1,000 invested in an acc.pdf
What is the future value in three years of $1,000 invested in an acc.pdf
 
Using SSMS create a database using an ERD diagram with the following.pdf
Using SSMS create a database using an ERD diagram with the following.pdfUsing SSMS create a database using an ERD diagram with the following.pdf
Using SSMS create a database using an ERD diagram with the following.pdf
 
What is the difference between the greenhouse effect and ozone deple.pdf
What is the difference between the greenhouse effect and ozone deple.pdfWhat is the difference between the greenhouse effect and ozone deple.pdf
What is the difference between the greenhouse effect and ozone deple.pdf
 
What is the difference between a primary and secondary follicle a.pdf
What is the difference between a primary and secondary follicle a.pdfWhat is the difference between a primary and secondary follicle a.pdf
What is the difference between a primary and secondary follicle a.pdf
 
What is the deadweight loss Use the following scenario for question.pdf
What is the deadweight loss Use the following scenario for question.pdfWhat is the deadweight loss Use the following scenario for question.pdf
What is the deadweight loss Use the following scenario for question.pdf
 
What is one way that gene flow can constrainslow down evolution by .pdf
What is one way that gene flow can constrainslow down evolution by .pdfWhat is one way that gene flow can constrainslow down evolution by .pdf
What is one way that gene flow can constrainslow down evolution by .pdf
 
What is Property Management System (PMS) Choose Opera PMS and bring.pdf
What is Property Management System (PMS) Choose Opera PMS and bring.pdfWhat is Property Management System (PMS) Choose Opera PMS and bring.pdf
What is Property Management System (PMS) Choose Opera PMS and bring.pdf
 
What is the correct definition of the term �relative price� 1.The r.pdf
What is the correct definition of the term �relative price� 1.The r.pdfWhat is the correct definition of the term �relative price� 1.The r.pdf
What is the correct definition of the term �relative price� 1.The r.pdf
 
What is meant by demonstrating capability Question 17 options 1) G.pdf
What is meant by demonstrating capability Question 17 options 1) G.pdfWhat is meant by demonstrating capability Question 17 options 1) G.pdf
What is meant by demonstrating capability Question 17 options 1) G.pdf
 
What is left in the process Terrestrial Inorganic Carbon Cycle Atmo.pdf
What is left in the process Terrestrial Inorganic Carbon Cycle Atmo.pdfWhat is left in the process Terrestrial Inorganic Carbon Cycle Atmo.pdf
What is left in the process Terrestrial Inorganic Carbon Cycle Atmo.pdf
 
What is climate change Why do scientists believe that this is a hum.pdf
What is climate change Why do scientists believe that this is a hum.pdfWhat is climate change Why do scientists believe that this is a hum.pdf
What is climate change Why do scientists believe that this is a hum.pdf
 
What Is Basic Text Functions In Python What was most rewarding fo.pdf
What Is Basic Text Functions In Python   What was most rewarding fo.pdfWhat Is Basic Text Functions In Python   What was most rewarding fo.pdf
What Is Basic Text Functions In Python What was most rewarding fo.pdf
 
What is a major benefit of using prototypes that solve a core custom.pdf
What is a major benefit of using prototypes that solve a core custom.pdfWhat is a major benefit of using prototypes that solve a core custom.pdf
What is a major benefit of using prototypes that solve a core custom.pdf
 
What is data integrity What are the sources of data in healthcare .pdf
What is data integrity What are the sources of data in healthcare .pdfWhat is data integrity What are the sources of data in healthcare .pdf
What is data integrity What are the sources of data in healthcare .pdf
 
What is a difference between skeletal and cardiac muscleA. Each m.pdf
What is a difference between skeletal and cardiac muscleA. Each m.pdfWhat is a difference between skeletal and cardiac muscleA. Each m.pdf
What is a difference between skeletal and cardiac muscleA. Each m.pdf
 
Use this information to answer questions 19-20Full-blown sickle c.pdf
Use this information to answer questions 19-20Full-blown sickle c.pdfUse this information to answer questions 19-20Full-blown sickle c.pdf
Use this information to answer questions 19-20Full-blown sickle c.pdf
 
What does the First Law of Thermodynamics state Question 2 options.pdf
What does the First Law of Thermodynamics state Question 2 options.pdfWhat does the First Law of Thermodynamics state Question 2 options.pdf
What does the First Law of Thermodynamics state Question 2 options.pdf
 
What is a financing costA. Any interest or dividends included as .pdf
What is a financing costA. Any interest or dividends included as .pdfWhat is a financing costA. Any interest or dividends included as .pdf
What is a financing costA. Any interest or dividends included as .pdf
 

Recently uploaded

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
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
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
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
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
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)
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
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
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 

Recently uploaded (20)

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
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
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
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 ...
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
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...
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 

Visual Studio C++ OOP I need to complete the program about how to .pdf

  • 1. Visual Studio C++ OOP I need to complete the program about how to play a WAV file in stereo. the program seems to play the WAV file in mono since it has a bad sound quality. chegg can't upload the WAV file, so I need you to use your own WAV file. #include #include #include "CAudio.h" #include "conio.h" typedef struct wav_header { // RIFF Header char riff_header[4]; // Contains "RIFF" int wav_size; // Size of the wav portion of the file, which follows the first 8 bytes. File size - 8 char wave_header[4]; // Contains "WAVE" // Format Header char fmt_header[4]; // Contains "fmt " (includes trailing space) int fmt_chunk_size; // Should be 16 for PCM short audio_format; // Should be 1 for PCM. 3 for IEEE Float short num_channels; int sample_rate; int byte_rate; // Number of bytes per second. sample_rate * num_channels * Bytes Per Sample short sample_alignment; // num_channels * Bytes Per Sample short bit_depth; // Number of bits per sample // Data char data_header[4]; // Contains "data" int data_bytes; // Number of bytes in data. Number of samples * num_channels * sample byte size // uint8_t bytes[]; // Remainder of wave file is bytes } wav_header; CAudio *lp; FILE *In; int g_No = 0;
  • 2. void CALLBACK Play_Proc(HWAVEOUT hWaveOut, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) { int Len=160; short Speech[160]; switch (uMsg) { case WOM_DONE: if (lp->PStart) { if (In!=NULL) fread(Speech, 2, 160, In); // 160 Sample Data if (feof(In)) fseek(In, 0, 0); lp->Play_Speech(Speech, Len); g_No += Len; printf("%dr", g_No++); } break; } } int main() { lp = new CAudio(); // 2.Play WAV File errno_t err; wav_header Buf; //if ((err = fopen_s(&In, "Speech.wav", "rb")) != 0) { printf("File Errorn"); return 0; } if ((err = fopen_s(&In, "file_example_WAV_1MG.wav", "rb")) != 0) { printf("File Errorn"); return 0; } //if ((err = fopen_s(&In, "guitartune.wav", "rb")) != 0) { printf("File Errorn"); return 0; } //if ((err = fopen_s(&In, "rbds_capture_47500.wav", "rb")) != 0) { printf("File Errorn"); return 0; } fread(&Buf, 1, sizeof(wav_header), In); printf("Sample Rate=%dn", Buf.sample_rate); printf("Channel =%dn", Buf.num_channels); printf("Bits/Sample=%dn", Buf.bit_depth); // 2.5 lp->Init_Audio(160, -1, -1, Buf.sample_rate); lp->Open_Play((DWORD)Play_Proc, CALLBACK_FUNCTION);
  • 3. lp->Start_Play(); //3.Play WAV File char c = _getch(); // 4. lp->Stop_Play(); lp->Close_Play(); // 5. fclose(In); In = NULL; }