Copyright © 2002 Bolton Institute Sound in SDL Andrew Williams

Slides:



Advertisements
Similar presentations
Add sound effects to a presentation Play music from a CD Playing music from a CD gives you a wealth of choices for background music. You can select tracks.
Advertisements

Using Audacity Audacity is an audio-editing application available from and can be used with most PC operating systems.
Royalty Free Music for Schools Do You Have the To Do a Podcast?
Video Production Tutorial Learn how to shoot, edit and export videos from second life.
Kimberly S. Rodriguez English Language Training Institute (ELTI), University of North Carolina at Charlotte December 2008.
Audio Programming With Python Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
Royalty Free Music for Schools Do You Have the To Do a Podcast?
David Meredith Minim David Meredith
Creating Games For Windows, Xbox 360, and Windows Phone 7 Ryan Plemons
10-Jun-15 Fibonacci Numbers A simple example of program design.
Copyright © 2002 Bolton Institute The AWSprite Library Andrew Williams
Games at Bolton Games Hardware, Architecture and Peripherals Andrew Williams
Games at Bolton Simple Directmedia Layer Andrew Williams
Bullets and Magazines Andrew Williams
Copyright © 2002 Bolton Institute Fonts Andrew Williams
Java Audio.
Games at Bolton Sound in SDL Andrew Williams adw1.
Introduction To XAudio2 © Allan C. Milne Abertay University v
Copyright © 2002 Bolton Institute Simple Directmedia Layer (SDL) Andrew Williams
How to use Audacity. Download Audacity is free to download from the internet. Unlike many downloadable programmes, Audacity is a once-only download -
Computer Programming For Musical Applications II Tutorial 08 Recording in SuperCollider 21st November, 2008.
Uploading movies from the Web and Embedding into Power point and adding Audio Mary Clarke-Miller Integrating technology into lessons using power point.
Lab 8 – C# Programming Adding two numbers CSCI 6303 – Principles of I.T. Dr. Abraham Fall 2012.
Josh Probert – Yankee A Prototype based on Sierra’s SRS.
Podcasting for Instruction Pam Williams Computer Resource Specialist New Castle Elementary.
© iPerimeter Ltd Unix and IBM i  AIX and Linux run natively on Power Systems  IBM i can do Unix type things in two ways:  Posix/QShell  Ordinary.
Creating a “Sound” Curriculum Breaking down strand 3 of the new ICT SoW Breaking down strand 3 of the new ICT SoW James Langley, Education Bradford.
The ePortfolio and Student Evaluation A training presentation by: Amy Cannady Robin Drewry Bonnie Hicks.
Digital recording software Presented by Andrew Littlefield.
Audio and Video CGS Some Common Audio Formats Format Use Extension MIDI instrumental music.mid MPEG songs.mp3 RealAudio live broadcasts.ra Wave.
PowerPoint 2008 Created by The Office of Media and Educational Technologies on: 07/2010 “This presentation contains copyright material used under the educational.
How to make a Power Point Relationship Narrative By Lisa Williams.
Playing Music in Alice By David Yan Under the direction of Professor Susan Rodger July 2015.
AUDIO MEDIA 1 Created } “Borrowed” } Microphone MIDI keyboard CD’s & flash drives Internet Audio Sources 2.
Activity 2 Mix a WAV file and the sound from a youtube video In this activity, we are going to mix the WAV file created in Activity 1and the sound file.
Sound or Audio, whichever you prefer –MIDI Files.midi or.mid (Musical Instrument Digital Interface) use for instrumental music. –This format is supported.
Copyright © 2003 Pearson Education, Inc. Chapter 5 – Slide 1 by Michael Kay The Web Wizard’s Guide to Flash.
11 Adding Sounds Session 7.1. Session Overview  Find out how to capture and manipulate sound on a Windows PC  Show how sound is managed as an item of.
PowerPoint Ingots This PowerPoint will comprise of the first four bullet points for Learning Outcomes.
Panning and Filters © Allan C. Milne Abertay University v
Podcasting. Why make a podcast? PROS Fast Distribution: Relatively Inexpensive: Simple: Added Modality: Accessibility: Facilitates “On the Go” Learning:
Digital Audio IV MIDI Overview. Sending MIDI Information I. Serial Transmission A. Single cable to move data B. Slower than parallel, but is less expensive.
Playing Music in Alice By David Yan Under the direction of Professor Susan Rodger July 2015.
● Click on Start Button ● Go to Programs and click on Photo Story 3.
CIS—100 Chapter 11—Adding Sound Effects 1. Inserting Sound with the Insert Tab 2 1. Click the Insert tab and locate the Media Clips Tab. 2. Click the.
1 CHAPTER 5 POINTER. 2 Pointers  Basic concept of pointers  Pointer declaration  Pointer operator (& and *)  Parameter passing by reference  Dynamic.
 Audacity has many different uses  Record live audio  Copy or splice sound tracks together  Change the speed or pitch of a recording  Import and.
Audio in Unreal By: Gabriel Scott. Sounds Formats All music has to be in.ogg format and preferably stereo All music has to be in.ogg format and preferably.
Sound Effects The library Cocosdenshion subproject of cocos2d-iphone targeted at game audio needs Sound effects can be loaded at application startup, so.
Photo Story. How to use Photo Story Photo Story 3 can be located in the Accessories folder on school computers. You will need to have your pictures already.
 Speech  Narration—also called voice overlay or voice track  Dialogue—between two or more characters  Direct Address—talking straight at the.
Editing Digital AudioLab#7 Audacity is a free, easy-to-use and an open source platform audio editor and recorder for Windows, Mac OS, Linux and other operating.
Audio Studio Learn How to use Mixcraft.Pro By: Alya Mabrook Alsaadi.
Using Audacity Let’s get Started Open Audacity. Getting started…
PROGRAMMING USING PYTHON LANGUAGE ASSIGNMENT 1. INSTALLATION OF RASPBERRY NOOB First prepare the SD card provided in the kit by loading an Operating System.
Garage Band For MAC. What is it? A digital audio workstation that can record and play back multiple tracks of audio. Is a software application for OS.
9. Media (sound effects, music, video) Let’s Learn Saengthong School, June – August 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
Bryant Tober. Problem Description  View the sound wave produced from a wav file  Apply different modulations to the wave file  Hear the effect of the.
Text Drawing & Playing Sound
INTRODUCTION TO ROBOTICS Part 5: Programming
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Objective % Explain concepts used to create digital audio.
System Programming and administration
Objective % Explain concepts used to create digital audio.
Adding Music to Your Google Slides Presentation
Runs, Parameter Sets, Outputs and Projects
Chapter 4: Representing sound
The Sound of Music… You Can Change It.
Objective Explain concepts used to create digital audio.
For Podcasts and Other Media
Presentation transcript:

Copyright © 2002 Bolton Institute Sound in SDL Andrew Williams

Copyright © 2002 Bolton Institute Sound in SDL There are two ways of doing sound: 1.SDL has some basic sound features built into it They are a bit complex to use They don’t support multiple channels There is a better alternative

Copyright © 2002 Bolton Institute Sound in SDL There are two ways of doing sound: 2.SDL_mixer Far more sophisticated Very easy to use for basic sound features Music Sound effects You should use SDL_mixer for your assignments

Copyright © 2002 Bolton Institute SDL_mixer A separate download Must be installed independently –Already available on the PCs in the lab and on the PS2s –Must also set up the project to use the SDL_mixer library

Copyright © 2002 Bolton Institute Installation ( SDL_mixer.h )

Copyright © 2002 Bolton Institute Installation ( SDL_mixer.lib )

Copyright © 2002 Bolton Institute Project Settings

Copyright © 2002 Bolton Institute Project Settings Don’t forget the.dll file; Put it in your project directory, or in C:\WINDOWS\System32

Copyright © 2002 Bolton Institute Playing Music 1.Open the audio device –We have to specify some parameters 2.Load in the music –We just need to supply the file name 3.Play the music –How many times do we want to hear it? 4.Stop the music –Only if necessary

Copyright © 2002 Bolton Institute 1. Open the Audio Device You only do this once per program /* We're going to be requesting certain things from our audio device, so we set them up beforehand */ int rate = MIX_DEFAULT_FREQUENCY; Uint16 format = AUDIO_S16; /* 16-bit stereo */ int channels = 2; // 2 for stereo, 1 for mono int buffers = 4096; /* Mix_OpenAudio takes as its parameters the audio format we'd _like_ to have. */ if(Mix_OpenAudio(rate, format, channels, buffers)) { printf("Unable to open audio!\n"); exit(1); }

Copyright © 2002 Bolton Institute 2. Load in the Music Note that you want.ogg format –Find some music here ( or convert your own with Audacity Mix_Music *music = NULL; music = Mix_LoadMUS(“hyporia.ogg"); if(!music) { printf("Error loading music: %s\n", Mix_GetError()); exit(1); }

Copyright © 2002 Bolton Institute Play the Music We have to decide how many times we want to hear the music /* This begins playing the music - the first argument is a pointer to Mix_Music structure, and the second is how many times you want it to loop (use -1 for infinite, and 0 to have it just play once) */ Mix_PlayMusic(music, -1);

Copyright © 2002 Bolton Institute Stop the Music Very simple: Directed study: –Look at: Mix_HookMusicFinished(...); /* Stop the music from playing */ Mix_HaltMusic();

Copyright © 2002 Bolton Institute Playing Sound-Effects 1.Open the audio device –See previous slides; you only do it once per program 2.Load in the.wav file 3.Play the sound

Copyright © 2002 Bolton Institute Load in the.wav File Very simple of course: /* We're going to pre-load the sound effects that we need here */ Mix_Chunk *phaser = NULL; phaser = Mix_LoadWAV("phaser.wav");

Copyright © 2002 Bolton Institute Play the Sound Effect This shows it integrated into the program: if(firing) { blast = laserblasts->allocate_a_bullet(); if(blast != NULL) { Mix_PlayChannel(-1, phaser, 0); blast->set_world_position(blahX, blahY); blast->set_velocities(0.0f, -5.0f); blast->set_accelerations(0.0f, -0.1f); blast->set_auto_accelerate(20); blast->set_auto_move(20); }