Real-time Multithreaded Architecture use Adobe Reader to complete Submission Report CSC 388/588 (Type in fields) 1
Student Information
Integrity Policy: All university integrity and class syllabus policies have been followed. I have neither given, nor received, nor have I tolerated others’ use of unauthorized aid.
I understand and followed these policies:
Copyright By PowCoder代写 加微信 powcoder
Name: Date:
Submission Details
Final Changelist number:
Verified build: Yes No
Required Configurations: YouTube Link:
Self Grading Section:
Required Features:
Basics Audio Playback
XAudio2 Voices
Attributes (volume, pan, pitch, etc.) Load / Unloading waves
XAudio2 Callbacks
Audio Management Handles
Buffer (wave data)
Voice (management) Timer Event System
Sound Duration Stitching
Seamless transitions between voices using Voice Callbacks Memory Leaking Verification
No Resources Leaking
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture use Adobe Reader to complete Submission Report
CSC 388/588 (Type in fields) YouTube Process
• Record the YouTube demo
o Youneedtorecordinstereowithcommentary
2 channel with both computer (desktop) and microphone recording o Use:OBSscreencapture
• Record the desktop (enough to show your directory and the visual studio and output) o Showyourdirectoryinrecording
Launch the visual studio (double click solution) o Showoffrelevantpartsofthecodewithcommentary o LaunchanddemotheSprint
Play the demo and add your commentary in real-time o Watchyourvideo
Verify that video clear and can you hear the commentary with audio in stereo?
• Note: Weekly Sprints cannot be longer that 15:00 mins o Ifyougoover…doitagain
• Publish your YouTube recording
o Makesureitisaccessiblewithoutanyloginorpermissiontoplay o Itcanbeprivatebutnotrestrictivetoplaybyanyonewiththelink
• Submit your code to perforce to the appropriate MS1 directory o form (this document)
• Submit this PDF to perforce o Fillinform
Name, changlelist, etc…
YouTube Link
o Submitbacktoperforce
Check it out and Submit it back to perforce to the same location
Verify Builds
• Follow the Piazza procedure on submission
o Verifyyoursubmissioncompilesandworksatthechangelistnumber.
• Verify that only MINIMUM files are submitted o No–Generatedfiles
*.pdb, *.suo, *.sdf, *.user, *.obj, *.exe, *.log, *.pdb, *.db, *.user
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture use Adobe Reader to complete Submission Report
CSC 388/588
(Type in fields)
Anything that is generated by the compiler should not be included o No–Generateddirectories
/Debug, /Release, /Log, /ipch, /.vs • Typical files project files that are required
o *.sln,*.cpp,*.h
o *.vcxproj,*.vcxproj.filters,CleanMe.bat
Standard Rules
Submit multiple times to Perforce
• Submit your work as you go to perforce several times (at least 5) o Assoonasyougetsomethingworking,submittoperforce o Havereasonablecheck-incomments
Points will be deducted if minimum is not reached
Write all programs in cross-platform C++
• Optimize for execution speed and robustness
• Working code doesn’t mean full credit
Submission Report
• Fill out the submission Report o Noreport,nograde
Code and project needs to compile and run
• Make sure that your program compiles and runs o WarninglevelALL…
o NOWarningsorERRORS
Your code should be squeaky clean. o Codeneedstowork“as-is”.
No modifications to files or deleting files necessary to compile or run. o Allyourcodemustcompilefromperforcewithnomodifications.
Otherwise it’s a 0, no exceptions
Project needs to run to completion
• If it crashes for any reason…
o Itwillnotbegradedandyougeta0
No Containers
• NO STL allowed {Vector, Lists, Sets, etc…}
o Noautomaticcontainersorarrays
o Youneedtodothistheoldfashionway-YOUEARNEDIT
Leave Project Settings
• Do NOT change the project or warning level
o Anychangingoflevelorsuppressionofwarningsisanintegrityissue
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture use Adobe Reader to complete CSC 388/588 (Type in fields)
Simple C++
• No modern C++
o NoLambdas,Autos,templates,etc… o NoBoost
• NO Streams
o Usedfopen,fread,fwrite…
• No code in MACROS
o Codeneedstobeincppfilestoseeanddebugiteasy
• Exception:
o implicit problem needs templates
Leaking Memory
• If the program leaks memory
o Thereisadeductionof20%ofgrade
• If a class creates an object using new/malloc o Itisresponsibleforitsdeletion
• Any MEMORY dynamically allocated that isn’t freed up is LEAKING o LeakingisHORRIBLE,soyoulosepoints
No Debug code or files disabled
• Make sure the program is returned to the original state
o Ifyouaddeddebugcode,pleasereturntooriginalstate
Submission Report Keenan
• If you disabled file, you need to re-enable the files
o Allfilesmustbeactivetogetcredit.
o Bettertolosepointsforunitteststhantodisableandloseallpoints
Allowed to Add files to this project
• This project compile as is… with whatever is submitted
UnitTestConfiguration file (if provided) needs to be set by user
• Grading will be on the UnitTestConfiguration settings
o Pleaseexplicitlysetwhichtestsyouwantgraded…noregradingifsetincorrectly
• See Piazza for due date and time
• Submit program perforce in your student directory assignment supplied.
• Fill out your this Submission Report and Milestone to perforce
o ONLYuseAdobeReadertofilloutform,allotherswillberejected. o Fillouttheformanddiscussionforfullcredit.
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture use Adobe Reader to complete CSC 388/588 (Type in fields)
• Demo the Audio Engine through 2 demos o Basics
o Stitching
• Summary of features
o AudiodemoinsideaGameproject
Space ship spinning while all the demos are working
o Atleast2threads
Game Thread Audio Thread
o Additionalthreads
Use to make the testing easy…. Let the threads work for you
Submission Report Keenan
o Allcommunicationismultithreaded
Game call sound system on Game Thread communicates to Audio or Audio/File
thread combo o Wavedataformat
All sound files are Wav files, 48 KHz, 32 bit PCM
Any wave data can be in Mono or Stereo form o Audiosystemsupports
2 speaker stereo configuration ONLY
This is needed for demos
o EverysoundonthegamethreadisprotectedwithHANDLES
Protects resources on the game side
Summary of Milestone
• Playlists
o WeintroduceaPlaylist
Game side calls a Playlist
• it creates an instance of sound (a voice and associates the wave data)
• from the playlist… you can start, stop, change attributes of the sound
Simple or complex
• A playlist can be simple as a single wave playing or more complicated
that associates several wave files playing with one controlling structure o Thisallowsseveralsoundstobeplayedfromasingleinstance
o Therearetwotypesofplaylistsintheaudioengine Simple Playlist
• Associates a wave file and a sound call name (ID)
• Creates one Voice and associates Wave data to the voice with internal
XAudio2 callbacks (if needed)
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture use Adobe Reader to complete Submission Report
CSC 388/588
(Type in fields) Keenan
Complex Playlist (use for Seinfeld)
• Special playlist to show off Voice Callbacks and stitching wave data
together on a voice
o Thisplaylistthataseriesofwavefilesthatareassociated
together through Voice callback on a SINGLE voice.
• Wave Files:
o Wave_A_to_B o Wave_B
o Wave_B_to_A o Wave_C
o Wave_C_to_A o Wave_END
• Basics Information
o Everysoundcallthatisactive
You can query the current status of • Volume
• Time – How long has it been playing
o Youcansetthefollowingattributes Volume
o Asoundisauniqueinstanceofaplaylist
So you can have several of the same playlist playing at once
You can control each instance individually • Miscellaneous
o MakesureyouhaveaTimersystemworking
Its need to do the demos on the Game Side For example:
• Start sound call A at 1500 ms
• Start sound call B at 2000 ms
• At 5000 ms, stop Sound call A
o Makesureyoucanreadakeyboardtotriggerademo For example:
• start Demo 1
o hitthe”1″key
• start Demo 2
o hitthe”2″key
• NO individual or special demos required o Onlytheserequireddemos
o Trying to make it easy for you.
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture use Adobe Reader to complete Submission Report
CSC 388/588 (Type in fields) General
0. Do all your working in MS1
a. Do all your development in MS1 for this milestone
b. Make sure you submit this project many times to perforce as you develop
i. You need to submit the project and the video for this Sprint
1. Research Threads, XAudio2, Voices and callbacks
a. Look up Voice callbacks
i. Explore the demos
b. Experiment with Data Buffers
i. Wave data with formatting structures
c. Passing data to threads to start and control audio
i. You need to communicate and have Audio thread control functionality
d. You need a Handle System
i. Make sure your resources are protected by handles
e. Contention between threads…
i. Should be protected with mutexes
Seinfeld Setup:
• Given simple mono wave samples o Sampledat48Khz,32-bit
• Create 1 Starting Seinfeld Voice Intro (aka. Script or function call that starts one voice) o Thistriggers–thefirstwave.
o Throughcallbacksoneatatime….
Stitch the 8 sound waves starting from that one voice
• We are demoing XAudio Callbacks on a voice (stitching together audio buffers)
o Option1–startsanothervoicetriggeredinthecallback Easiest option – for this demo
• Callback starts a new voice in the callback
• Allows the next voice to be stitched on the master voice list
Difficult to adjust a single volume, pan, pitch once you start this playlist
• Since there are several voices effectively being stitched together. o Option 2 – append audio on single voice
This is a harder option, but the benefit is a single voice controls the volume, pitch and pan. Easy to adjust
• Wave flow o NOTE:
• Appends an audio buffer data on the one and only voice
o ThecallbackappendsdifferentdataontheSINGLEvoice
• Difficult part:
o Need persistent state or linking waves for wave data appending
You need to do the individual stitching in the callback.
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture use Adobe Reader to complete
Submission Report SC 388/588
(Type in fields)
Triggering one voice at a time in callback (option1)
Or Adding one buffer at a time in callback (option 2) o Orderingofwaves
1. Intro 2. A
3. AtoB 4. B
5. BtoC 6. C
7. CtoA 8. End
2. Demo cannot LEAK resources or memory
a. Make sure you shut down all resources and threads correctly
b. Add a special Key to kill the program before exit
i. Key Q – QUIT is a good choice
ii. Then escape key to close the window
c. Need to see that there is no Memory Leaks on exit
3. For Demo timing…
a. Use std::this_thread::sleep_for() to control the time… b. If you need to sequence actions in the demo
4. Do not have any Threads spin directly
a. For example Audio Thread…
i. As long as there is input… grab the input
ii. Then have the Audio Thread sleep for 1 ms before grabbing input again
5. Sound not specified
a. Default Attributes: i. Vol: 70%
ii. Pan: Center iii. Pitch: Original
6. Deliverables
• Stand-alone C++ demo
o CreateademotoshowofftheALLoftheabovefeatures
o Useaudiosamplesthatallowyoutodemonstratetheabovefeatureseasily
• Visual Studio 2019 Enterprise Edition
o C++warninglevelALL,minimumcode,notemporariesorgenerateditems
o Needstobeabletocompileandrun“as-is”withoutcheckingoutfromperforceor
changing the attributes of the files
• For some people – the demo is hardest part of this exercise
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture CSC 388/588
Demo 1: Basics
• Given 5 simple mono wave samples o Sampledat48Khz,32-bit
use Adobe Reader to complete
(Type in fields)
Submission Report Keenan
• Create 5 separate simple playlists (scripts) – one sound wave, one sound ID o 101-Fiddle
o 102-Bassoon
o 103-Oboe2_mono o 104-SongA
o 105-SongB
Start Demo 1 –hit the “1” key to trigger it
• This is triggered in the update() method of the game o Readthekeyboardinput
o ThenloadandgowithyourDemo1
• The demo should play from there.
o Nouserinterventionneeded–justneedthetimertriggersworking. Part A: Load
• Setup your playlists
o Loadallthemonowavedatafor101-105initiateonthegameside
It’s OK to have the playlist table on the Audio Thread side
o Butitcannotloadthewavedata,thathastobeinitiatedonthegameside
• Load all the timer events for this demo at once – let the timer/threads do the work Part B: preset pan test
• Timer: 0 seconds
o Play101withpanincenter
• Timer: 3 seconds
o Play101withpan100%left
• Timer: 6 seconds
o Play101withpan100%right
Part C: runtime panning adjustment with write only
• Timer: 10 seconds
o Play102withpan100%leftandmoveitto100%right
By setting the attribute directly
• Every 1ms change the panning…
o Smoothlyfor2seconds
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture use Adobe Reader to complete CSC 388/588 (Type in fields)
• Timer: 15 seconds
o Play102withpan100%rightandmoveitto100%left
By setting the attribute directly
• Every 1ms change the panning
o Smoothlyfor2seconds
Part D: runtime volume adjustment with a read modify write
Submission Report Keenan
• Timer: 20 seconds
o Play103withvolumeat0%andrampupthevolumesmoothlyto100% o Smoothlyacross2seconds
Do this by 1st – reading the current volume
Then add a delta to the volume and set the attribute directly
• Every 1ms change the volume
• Timer: 25 seconds
o Play103withvolumeat100%andrampdownthevolumesmoothlyto0% o Smoothly across 2 seconds
Do this by 1st – reading the current volume
Then add a delta to the volume and set the attribute directly
• Every 1ms change the volume Part E: Stereo effect from mono
• Timer: 30 seconds
o Play104withpan100%left
o Play105withpan100%right
• Timer: 35 seconds
o PrintintheDebugger’sOutputscreenthetime104hasbeenplayinginseconds (since it started playing)
Need to use the timer…no hard coding numbers
• Timer: 38 seconds
o PrintintheDebugger’sOutputthetime104hasbeenplayinginseconds (since it started playing)
Need to use the timer…no hard coding numbers
• Timer: 60 seconds
o PrintintheDebugger’sOutputscreenthetime104hasbeenplayinginseconds (since it started playing)
Need to use the timer…no hard coding numbers o Stop104
• Timer: 72 seconds
o PrintintheDebugger’sOutputscreenthetime105hasbeenplayinginseconds
(since it started playing)
Need to use the timer…no hard coding numbers o Stop105
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture CSC 388/588
Part F: Instancing several sounds
• Timer: 80 seconds
o SndA=Start102
o setvolto40%
• Timer: 80.5 seconds
o SndB=Start102
o setvolto40%
• Timer: 81 seconds
o SndC=Start102
o setvolto40%
• Timer: 81.5 seconds
o SndD=Start102
o setvolto40%
• Timer: 81.5 seconds
o StopSndA o StopSndB o StopSndC
use Adobe Reader to complete
(Type in fields)
Submission Report Keenan
• Timer: 82 seconds and beyond
o LetSndD–playanddiewithoutintervention
Demo 2: Voice Stitching – using XAudio2 Callbacks
• See above description on Seinfeld:
o Given8simplemonowavesamples
Sampled at 48Khz, 32-bit
• Create 8 separate simple waves
o Intro_mono o A_mono
o AtoB_mono o B_mono
o BtoC_mono o C_mono
o CtoA_mono o End_mono
• On controlling playlist
o SndID201–isthecontrollerforthisplaylist
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture use Adobe Reader to complete CSC 388/588 (Type in fields)
Start Demo 2 –hit the “2” key to trigger it
• This is triggered in the update() method of the game o Readthekeyboardinput
o ThenloadandgowithyourDemo2
• The demo should play from there.
o Nouserinterventionneeded–justneedthetimertriggersworking.
• Print the name of each wave as it stitched in the XAudio2 Callback
Submission Report Keenan
o Sinceonlyonewaveisstitchedatatime
o Thenamesshouldbeprintedatintervalsproportionaltotheindividualwaveplayback
They shouldn’t be burst on the screen
Instead one at a time… with delays between them
Part A: Load
• Setup your playlists
o Loadallthemonowavedataneededfor201initiateonthegameside o It’sOKtohavetheplaylisttableontheAudioThreadside
Create the callbacks for the voices (option 1 or 2)
o Audiosidecannotloadthewavedata,thathastobeinitiatedonthegameside
• Load all the timer events for this demo at once – let the timer/threads do the work Part B: Start the demo
• On the Game THREAD o At0seconds
Play 201, pan center, volume 80%
• Print the name of each wave as it stitched in the XAudio2 Callback
o Sinceonlyonewaveisstitchedatatime
o Thenamesshouldbeprintedatintervalsproportionaltothe
individual wave playback
They shouldn’t be burst on the screen
Instead one at a time… with delays between them
o At10seconds
Pan Right 201, volume 80%
o At20seconds
Pan Left 201, volume 80%
o At30seconds
Pan Center 201, volume 80%
• Repeat the panning pattern
o Center,Right,Left–10secondsapart
Do this until the audio ends
Real-time Multithreaded Architecture Milestone
Real-time Multithreaded Architecture use Adobe Reader to complete CSC 388/588 (Type in fields)
Exit the Game cleanly
• Send the Kill command o KeyQ
• Then close the window by hitting escape
• MUST show the game shutting down cleanly with no memory leaks.
Validation
Simple checklist to make sure that everything is submitted correctly
Submission Report Keenan
• Submitted project to perforce correctly
o Istheprojectcompilingandrunningwithoutanyerrorsorwarnings? o Isthesubmissionreportfilledinandsubmittedtoperforce?
o Followtheverificationprocessforperforce
Is all the code there and compiles “as-is”?
No extra files
o Istheprojectleakingmemorywhenshuttingdown?
• Submitted the YouTube link to perforce?
• Is it recorded clearly, loudly, and in stereo?
Most assignments will have hints in a section like this.
• Dig into the material read the online blogs… o Lotsandlotsofinformation
• Use the ORUMs
o Read,explore,askquestions
Real-time Multithreaded Architecture Milestone
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com