Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Getting Started with C++ Audio Programming for Game Development
  • Table Of Contents Toc
Getting Started with C++ Audio Programming for Game Development

Getting Started with C++ Audio Programming for Game Development

By : David da L Gouveia
4.8 (4)
close
close
Getting Started with C++ Audio Programming for Game Development

Getting Started with C++ Audio Programming for Game Development

4.8 (4)
By: David da L Gouveia

Overview of this book

Audio plays a fundamental role in video games. From music to sound effects or dialogue, it helps to reinforce the experience, convey the mood, and give feedback to the player. Presently, many games have achieved commercial success by incorporating game sounds that have enhanced the user experience. You can achieve this in your games with the help of the FMOD library. This book provides you with a practical guide to implementing the FMOD toolkit in your games. Getting Started with C++ Audio Programming for Game Developers is a quick and practical introduction to the most important audio programming topics that any game developer is expected to know. Whether you need to play only a few audio files or you intend to design a complex audio simulation, this book will help you get started enhancing your game with audio programs. Getting Started with C++ Audio Programming for Game Developers covers a broad range of topics – from loading and playing audio files to simulating sounds within a virtual environment and implementing interactive sounds that react to events in the game. The book starts off with an explanation of the fundamental audio concepts, after which it proceeds to explain how to use the FMOD Ex library, how to implement a 3D audio simulation, how to use the FMOD Designer toolkit, and how best to work with multi-layered sounds with complex behaviors attached to them. The final part of the book deals with working with audio at a much lower level by manipulating audio data directly. This book will provide you with a good foundation so that you can successfully implement audio into your games and begin pursuing other advanced topics in audio programming with confidence.
Table of Contents (13 chapters)
close
close
Getting Started with C++ Audio Programming for Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1
Index

Implementing a delay effect


We have already discussed, back in Chapter 4, 3D Audio, that DSP effects are algorithms that modify the audio data to achieve a certain goal. Now we will see an example of how to implement a simple delay effect. The way a basic delay effect works, is to keep a separate buffer of data, and store the audio data that has already played in it. The size of the buffer determines how long it takes between the original sound and its echo plays. Then, we simply need to mix the audio data that is playing, with a portion of the old signal that was stored in the buffer, which produces a delay. Let us examine the following MyDelay class definition, which encapsulates the effect:

class MyDelay {
public:
  MyDelay(float time, float decay);
  ~MyDelay();
  void WriteSoundData(PCM16* data, int count);

private:
  PCM16* buffer;
  int size;
  int position;
  float decay;
};

The MyDelay class constructor takes two parameters, time and decay. The first parameter controls how many seconds...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Getting Started with C++ Audio Programming for Game Development
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon