Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Game Audio Development with Unity 5.X
Game Audio Development with Unity 5.X

Game Audio Development with Unity 5.X: Design a blockbuster game soundtrack with Unity 5.X

eBook
€8.99 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Game Audio Development with Unity 5.X

Scripting Audio

Unity is a powerful game engine that provides an excellent editor interface that allows you to develop games without any coding skills using various predeveloped assets. However, while it is possible to build games without code, it is less practical and will just restrict your creativity in the end. The scripting engine in Unity is powerful and relatively easy to use, especially if you have any experience or knowledge of using a C style language (JavaScript, C, C++, Java, and C#). Even if you are here as a sound designer looking for tips on how to work with audio in Unity, you will benefit greatly from learning some scripting. For those of you who are quite familiar with scripting in Unity, don't run off to the next chapter. While this chapter will cover scripting at a basic level, it still will focus primarily on working with audio components.

This chapter...

Introduction to scripting in Unity

In this section, our goal is to understand how Unity scripts integrate as components on top of GameObjects. If you recall from Chapter 1, Introducing Game Audio in Unity, all the functionality built into Unity is in the form of components and components are just scripts and code. Take a look at the following diagram, which should demonstrate the basic concepts of a GameObject and Component:

A simplistic view of how components combine to create various game objects

As the diagram shows, all objects are derived from GameObject, which means, they all essentially share the same base level object. If you look at the bottom of the objects in the diagram, you will see a component called MonoBehaviour with Transform. As we will see, MonoBehaviour is the base component, that we will generally derive other components or scripts from.

Not all components...

Building a musical keyboard

Now that we have looked at how quickly we can create a simple empty script, let's explore the possibilities of scripting audio components. As we already saw in the last chapter, it is possible to use audio components without writing any scripts. However, scripting gives you more control over an audio source with only a few lines of code.

In this section, we are going to use scripting to build a simple keyboard that you will be able to play multiple instruments with. We will even allow the keyboard to record and play back sessions. All in less than 30 lines of code. Follow the instructions here, to start creating this script:

  1. We will continue where we left off from the last time by jumping back into MonoDevelop. Be sure the tab showing the Keyboard script is open and the script shell has not been modified.
  2. At the top of the file, just below the...

Weapons and sound

In the last couple of sections of the last chapter, we introduced ambient sounds as the first layer or group of audio to our Viking Village. For this section, we are going to introduce a new layer of audio, the direct feedback group. If you recall from the introduction in the first chapter, this is the layer of audio that covers sounds activated by a player action or reaction within the game, which may include audio such as explosions, weapons, character dialog, or boss music.

Back in Chapter 1, Introducing Game Audio with Unity, we introduced the terms diegetic and non-diegetic. Are you able to categorize the audio we have used thus far or in the next examples as diegetic or non-diegetic? A quiz will be provided at the end of this section.

What better way to introduce direct feedback audio than by adding a weapon and the sounds associated with a weapon. For...

Randomizing audio

Randomizing audio is the practice of tuning an audio source playback in a random manner to avoid exact repetition in your games audio. Of course, another way to avoid audio repetition is create multiple sound effects for the same noise, music or dialog, and then randomly select one each time the audio needs to be played. While using multiple variations of the same audio clip is preferred it does increase memory resource usage and asset management.

For this section, we are going to borrow a couple techniques we already used to slightly alter or randomize the playback of our audio without needing to provide multiple variations. Open up Unity and follow the following exercise to randomize the scene audio:

  1. Locate the axController script in the Project window and then double-click on the script to open it in your editor.
  2. Scroll down to around line 21 as shown here...

Background music

In the last section of this chapter, we will introduce another layer of audio with background or theme music. This is an often overlooked layer that can really set the mood of the game or during the progression of a game. In later chapters of this book where we cover adaptive music we will get into detailed examples of altering music during gameplay. For now though, we are going to look at a simple use of scripting to set the looping behavior of some background music we want to use for our scene. Follow the instructions here to add background music to the scene:

  1. Open up Unity to the Viking Village scene as we last left it. Create an empty GameObject in the scene and rename it BackgroundMusic.
  2. Locate the viking_music audio clip in the Project window. Drag the clip onto the new BackgroundMusic object in the Hierarchy window. This will automatically add an audio...

Summary

In this chapter, we introduced Unity scripting at a very high level. Even a basic understanding of scripting will be essential to sound designers or other artists working on Unity projects, as it provides them with the ability to make simple changes without interrupting a dedicated developer. From a basic scripting introduction, we worked our way into a more practical example of writing a simple musical keyboard. It not only introduced additional scripting concepts but also exposed how some of the essential audio source component properties can be altered to match an instrument. After that, we jumped back into the Viking Village project and looked at another good scripting example that showcased weapons. Through repeated testing of our scene we then realized our audio was becoming quite repetitive. The solution was to introduce volume and pitch randomization on our audio...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • 1. Explore the basics of audio development in Unity to create spatial sound, mixing, effects, composition, adaptive audio and more.
  • 2. Leverage the Audio Mixer of Unity 5.x to create blockbuster sound and music for your game.
  • 3. Learn about developing professional audio for games with FMOD Studio and composing original music with Reaper.
  • 4. Build amazing audio synchronized graphic visualizations with Unity.
  • 5. Understand how real-time character lip syncing can be implemented.

Description

Game Audio is one of the key components in making a game successful and it is quite popular in the gaming industry. So if you are a game developer with an eye on capturing the gamer market then this book is the right solution for you. In this book, we will take you through a step by step journey which will teach you to implement original and engaging soundtracks and SFX with Unity 5.x. You will be firstly introduced to the basics of game audio and sound development in Unity. After going through the core topics of audio development: audio sources, spatial sound, mixing, effects, and more; you will then have the option of delving deeper into more advanced topics like dynamic and adaptive audio. You will also learn to develop dynamic and adaptive audio using the Unity Audio Mixer. Further, you will learn how professional third party tools like FMOD are used for audio development in Unity. You will then go through the creation of sound visualization techniques and creating your own original music using the simple yet powerful audio workstation Reaper. Lastly, you will go through tips, techniques and strategies to help you optimize game audio performance or troubleshoot issues. At the end of the book, you’ll have gained the skills to implement professional sound and music. Along with a good base knowledge audio and music principles you can apply across a range of other game development tools.

Who is this book for?

The ideal target audience for this book will be game developers, both Indie as well as semi pro. No prior knowledge of Unity and audio development is assumed,

What you will learn

  • • Develop game audio and other audio effects with Unity
  • • Getting familiar with the new Audio Mixer introduced in Unity 5
  • • Implement dynamic and adaptive audio using various tools and strategies
  • • Explore interesting ways to incorporate audio into a game with sound visualization
  • • Use 3rd party professional audio development tools like FMOD
  • • Compose original music and record vocals
  • • Understand and troubleshoot audio performance issues

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 30, 2017
Length: 404 pages
Edition : 1st
Language : English
ISBN-13 : 9781787120808
Vendor :
Unity Technologies
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jun 30, 2017
Length: 404 pages
Edition : 1st
Language : English
ISBN-13 : 9781787120808
Vendor :
Unity Technologies
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 115.97
Mastering Unity 2017 Game Development with C#
€41.99
Unity 2017 Game Optimization
€36.99
Game Audio Development with Unity 5.X
€36.99
Total 115.97 Stars icon
Banner background image

Table of Contents

11 Chapters
Introducing Game Audio with Unity Chevron down icon Chevron up icon
Scripting Audio Chevron down icon Chevron up icon
Introduction to the Audio Mixer Chevron down icon Chevron up icon
Advanced Audio Mixing Chevron down icon Chevron up icon
Using the Audio Mixer for Adaptive Audio Chevron down icon Chevron up icon
Introduction to FMOD Chevron down icon Chevron up icon
FMOD for Dyanmic and Adaptive Audio Chevron down icon Chevron up icon
Visualizing Audio in Games Chevron down icon Chevron up icon
Character Lip Syncing and Vocals Chevron down icon Chevron up icon
Composing Music Chevron down icon Chevron up icon
Audio Performance and Troubleshooting Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(2 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
DANIEL ROMAN Dec 20, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Amazing book for beginners in game audio.
Amazon Verified review Amazon
IvanDBeltran Oct 29, 2020
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Conceptually the book is an excellent resource. It contains step-by-step instructions which serve as a starting point for further development. However, the example project will not work with newer versions of Unity out-of-the-box, some tweaking needs to be done updating deprecated classes in the project to make it work which will not make it suitable for beginners. The audio assets provided could also be better, although it is understandable that is not the scope of the book.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.