This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <SDL2/SDL.h> | |
| #include <SDL2/SDL_mixer.h> | |
| #define WAV_PATH "Roland-GR-1-Trumpet-C5.wav" | |
| #define MUS_PATH "HR2_Friska.ogg" | |
| // Our wave file | |
| Mix_Chunk *wave = NULL; | |
| // Our music file | |
| Mix_Music *music = NULL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <SDL2/SDL.h> | |
| #define MUS_PATH "Roland-GR-1-Trumpet-C5.wav" | |
| // prototype for our audio callback | |
| // see the implementation for more information | |
| void my_audio_callback(void *userdata, Uint8 *stream, int len); | |
| // variable declarations | |
| static Uint8 *audio_pos; // global pointer to the audio buffer to be played |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright 2011 Maciej Ciemborowicz | |
| * https://maciej-ciemborowicz.eu | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * |