Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef AUDIOMANAGER_H
- #define AUDIOMANAGER_H
- /**DESCRIPTION: The platform-dependent class used to manage audio playback.**/
- /**C INCLUDES**/
- #include "stdio.h"
- #include "stdlib.h"
- #include "string.h"
- #include "math.h"
- /**C++ INCLUDES**/
- #include <vector>
- /**PLATFORM INCLUDES**/
- #include <PortAudio\portaudio.h>
- /**ENGINE INCLUDES**/
- #include "AudioInstance.h"
- /*DEFINITIONS*/
- #define SAMPLE_RATE 44100
- #define FRAMES_PER_BUFFER 1
- #define SAMPLES_PER_BUFFER (FRAMES_PER_BUFFER * 2)
- class AudioManager{
- public:
- //Constructor
- AudioManager();
- //Destructor
- ~AudioManager();
- //Functions
- //Initializes the platform's audio library.
- void Init();
- //Updates the AudioManager. Used to get rid of audio that has completed playback.
- void Update();
- //Plays an Audio file.
- void PlayAudio(AudioInstance* audioObject);
- //Pauses an Audio file.
- void PauseAudio();
- //Stops an Audio file, essentially a pause and reset.
- void StopAudio();
- //Shuts down the platform's audio library and releases memory.
- void Destroy();
- //Members
- //The audio data that is to be output to the speakers.
- PaStream* outputStream = NULL;
- //A pointer to memory allocated to store audio data.
- short* audioData = NULL;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment