set_wavoutput added to set writing audio out to a wav file

This commit is contained in:
Przemyslaw Iwanowski 2013-01-30 19:34:56 +00:00
parent dbbf6ef012
commit 609d274573
2 changed files with 28 additions and 2 deletions

View File

@ -111,6 +111,8 @@ FmodAudioManager() {
_up.y = 0;
_up.z = 0;
_saved_outputtype = FMOD_OUTPUTTYPE_AUTODETECT;
if (_system == (FMOD::System *)NULL) {
// Create the global FMOD System object. This one object must be
// shared by all FmodAudioManagers (this is particularly true on
@ -562,6 +564,24 @@ get_volume() const {
return (PN_stdfloat)volume;
}
////////////////////////////////////////////////////////////////////
// Function: FmodAudioManager::set_wavwriter()
// Access: Public
// Description: Changes output mode to write all audio to a wav file.
////////////////////////////////////////////////////////////////////
void FmodAudioManager::
set_wavwriter(bool outputwav) {
ReMutexHolder holder(_lock);
if (outputwav) {
_system->getOutput(&_saved_outputtype);
_system->setOutput(FMOD_OUTPUTTYPE_WAVWRITER);
}
else {
_system->setOutput(_saved_outputtype);
}
}
////////////////////////////////////////////////////////////////////
// Function: FmodAudioManager::set_active(bool active)
// Access: Public

View File

@ -98,7 +98,7 @@ class EXPCL_FMOD_AUDIO FmodAudioManager : public AudioManager {
virtual ~FmodAudioManager();
virtual bool is_valid();
virtual PT(AudioSound) get_sound(const string&, bool positional = false, int mode=SM_heuristic);
virtual PT(AudioSound) get_sound(MovieAudio *, bool positional = false, int mode=SM_heuristic);
@ -107,7 +107,11 @@ class EXPCL_FMOD_AUDIO FmodAudioManager : public AudioManager {
virtual void set_volume(PN_stdfloat);
virtual PN_stdfloat get_volume() const;
virtual void set_wavwriter(bool);
virtual void set_wavwriter(bool);
virtual void set_active(bool);
virtual bool get_active() const;
@ -199,6 +203,8 @@ private:
typedef pset<FmodAudioSound *> SoundSet;
SoundSet _all_sounds;
FMOD_OUTPUTTYPE _saved_output;
////////////////////////////////////////////////////////////
//These are needed for Panda's Pointer System. DO NOT ERASE!
////////////////////////////////////////////////////////////