logo资料库

Getting Started with C++ Audio Programming for Game Development.pdf

第1页 / 共117页
第2页 / 共117页
第3页 / 共117页
第4页 / 共117页
第5页 / 共117页
第6页 / 共117页
第7页 / 共117页
第8页 / 共117页
资料共117页,剩余部分请下载后查看
Cover
Copyright
Credits
About the Author
About the Reviewers
www.PacktPub.com
Table of Contents
Preface
Chapter 1: Audio Concepts
Sound waves
Analog and digital audio
Multi-channel audio
Audio file formats
Summary
Chapter 2: Audio Playback
Understanding FMOD
Installing FMOD Ex Programmer's API
Creating and managing the audio system
Loading and streaming audio files
Playing sounds
Checking for errors
Project 1 – building a simple audio manager
Class definition
Initialization and destruction
Loading or streaming sounds
Playing sounds
A note about the code samples
Summary
Chapter 3: Audio Control
The channel handle
Controlling playback
Controlling the volume
Controlling the pitch
Controlling the panning
Grouping channels together
Controlling groups of channels
Project 2 – improving the audio manager
Class definition
Initialization and destruction
Loading songs and sound effects
Playing and stopping sound effects
Playing and stopping songs
Controlling the master volume of each category
Summary
Chapter 4: 3D Audio
Positional audio
Positional audio in FMOD
Creating an audio source
Setting the audio source position and velocity
Setting the audio source direction
Setting the audio source range
Setting the audio listener properties
Integration with a game
Reverb
Reverb in FMOD
Creating a reverb object
Setting reverb properties
Setting reverb position and radius
Setting the default ambient reverb
Obstruction and occlusion
Obstruction and occlusion in FMOD
Effects
Effects in FMOD
Example 1 – time stretching
Example 2 – simple radio effect
Summary
Chapter 5: Intelligent Audio
Audio files versus sound events
Introducing the FMOD Designer
Simple events
Examples of simple events
Avoiding repetitive sound effects
Creating a footsteps sound loop
Creating a breaking glass sound effect
Creating an ambient track of singing birds
Multi-track events
Examples of multi-track events
Creating an interactive footsteps sound loop
Simulating the sound of a car engine
Creating a complex ambient track of a forest
Interactive music
The vertical approach (re-orchestration)
The horizontal approach (re-sequencing)
Calling sound events from the game code
Summary
Chapter 6: Low-level Audio
Representing audio data
Playing audio data
Loading a sound
Playing a sound
Pausing a sound
Looping a sound
Changing volume
Changing pitch
Changing panning
Mixing multiple sounds
Implementing a delay effect
Synthesizing a sound
Summary
Index
Getting Started with C++ Audio Programming for Game Development A hands-on guide to audio programming in game development with the FMOD audio library and toolkit David Gouveia BIRMINGHAM - MUMBAI
Getting Started with C++ Audio Programming for Game Development Copyright © 2013 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: August, 2013 Production Reference: 1190813 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-84969-909-9 www.packtpub.com Cover Image by Suresh Mogre (suresh.mogre.99@gmail.com)
Credits Author David Gouveia Reviewers Tomas Pettersson Daniel Varela Acquisition Editor Edward Gordon Commissioning Editor Shreerang Deshpande Technical Editors Larissa Pinto Nitee Shetty Project Coordinator Suraj Bist Proofreader Lesley Harrison Indexer Tejal Soni Graphics Abhinash Sahu Production Coordinator Melwyn D'sa Cover Work Melwyn D'sa
About the Author David Gouveia is a Software Engineer and Game Developer from Portugal, Madeira Island. He recently finished his MSc in Computer Science, with a specialization in graphics and multimedia, and is currently working full-time as a game programmer for a local company. He runs an educational blog about game development and enjoys sharing his knowledge with the community whenever possible. His main interests in game development are graphics and audio programming. He also has a strong interest in music and synthesizers, having played the keyboard most of his life.
About the Reviewers Tomas Pettersson is a creator of the freeware audio tools SFXR and Musagi. Daniel Varela was born in Trebujena, Spain, in 1980. His strong passion for music and technology led him to obtain a Bachelor's degree in Sound and Image Engineering from the University of Málaga, Spain, in 2004. From very early on in his education, he focused on digital audio signal processing, designing and developing software simulations for audio signals quantification noise modeling, experimental reverb effects, and culminating in an application for the digital audio editing as his final project of studies. After graduating, he worked for six years in the software consultancy area as an Applications Programmer and Analyst. During this stage, he improved his Object Oriented Programming skills and working methodology, but however, he felt like something was missing. In 2010, he joined TheGameKitchen, a just born indie videogames development company, as a Generalist Programmer. During this period, he made familiar game engines, such as XNA or Unity3D and developed some audio application prototypes, such as a MOD tracker player for XNA or a scratching application for Windows Phone. In 2011, he started working at BlitzGamesStudios in the UK as Audio Programmer, developing a successful career in the area of audio programming for videogames. He is responsible for maintaining and improving an existing cross platform end to end audio pipeline, as well as working with third party audio middleware such as FMOD and Wwise.
www.PacktPub.com Support files, eBooks, discount offers and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why Subscribe? • Fully searchable across every book published by Packt • Copy and paste, print and bookmark content • On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Table of Contents Preface Chapter 1: Audio Concepts Sound waves Analog and digital audio Multi-channel audio Audio file formats Summary Chapter 2: Audio Playback Understanding FMOD Installing FMOD Ex Programmer's API Creating and managing the audio system Loading and streaming audio files Playing sounds Checking for errors Project 1 – building a simple audio manager Class definition Initialization and destruction Loading or streaming sounds Playing sounds A note about the code samples Summary Chapter 3: Audio Control The channel handle Controlling the playback Controlling the volume Controlling the pitch Controlling the panning Grouping channels together 1 7 7 9 11 11 12 13 13 14 15 16 17 18 19 19 21 22 22 23 24 25 25 26 27 27 29 30
分享到:
收藏