15 #include "config_audio.h" 17 #include "filterProperties.h" 18 #include "audioLoadRequest.h" 19 #include "audioManager.h" 20 #include "audioSound.h" 21 #include "nullAudioManager.h" 22 #include "nullAudioSound.h" 23 #include "string_utils.h" 25 Configure(config_audio);
26 NotifyCategoryDef(audio,
"");
29 (
"audio-active",
true);
32 (
"audio-cache-limit", 15,
33 PRC_DESC(
"The number of sounds in the cache."));
36 (
"audio-library-name",
"null");
39 (
"audio-volume", 1.0f);
44 (
"audio-doppler-factor", 1.0f);
47 (
"audio-distance-factor", 1.0f);
50 (
"audio-drop-off-factor", 1.0f);
53 (
"audio-buffering-seconds", 3.0f,
54 PRC_DESC(
"Controls the amount of audio buffering when streaming audio. " 55 "If you are playing a streaming sound, and any single frame " 56 "takes longer than this, the audio will stutter. Caution: " 57 "buffering streaming audio takes a lot of memory. For example, " 58 "5 seconds of stereo audio at 44,100 samples/sec takes one " 59 "megabyte. The 3-second default is intentionally high, favoring " 60 "correctness over efficiency, but for a commercial application " 61 "you may wish to lower this."));
64 (
"audio-preload-threshold", 1000000,
65 PRC_DESC(
"If the decompressed size of a sound file exceeds this amount, " 66 "then Panda3D will not attempt to store that sound file in RAM. " 67 "Instead, it will stream the sound file from disk. It is not " 68 "practical to stream multiple sound-files from disk at the same " 69 "time - the hard drive seek time makes it stutter."));
74 (
"audio-min-hw-channels", 15,
75 PRC_DESC(
"Guarantee this many channels on the local sound card, or just " 76 "play EVERYTHING in software."));
81 (
"fmod-number-of-sound-channels", 128,
82 PRC_DESC(
"Guarantee this many channels you will have with FMOD. AKA the max number of sounds you can play at one time.") );
85 (
"fmod-use-surround-sound",
false,
86 PRC_DESC(
"Determines if an FMOD Flavor of PANDA use 5.1 Surround Sound or not. " 87 "This variable is deprecated and should not be used. Use the enum " 88 "variable fmod-speaker-mode instead."));
91 (
"fmod-speaker-mode", FSM_unspecified,
92 PRC_DESC(
"Sets the speaker configuration that the FMOD sound system will use. " 93 "Options: raw, mono, stereo, quad, surround, 5.1 and 7.1. "));
99 (
"audio-software-midi",
true);
103 PRC_DESC(
"Specifies a DLS file that defines an instrument set to load " 104 "for MIDI file playback. If this is not specified, the sound " 105 "interface will try to use the system default DLS file, if " 106 "one is available; the likely success of this depends on the " 107 "operating system."));
110 (
"audio-play-midi",
true);
113 (
"audio-play-wave",
true);
116 (
"audio-play-mp3",
true);
119 (
"audio-output-rate", 22050);
122 (
"audio-output-bits", 16);
125 (
"audio-output-channels", 2);
127 ConfigureFn(config_audio) {
128 FilterProperties::init_type();
129 AudioLoadRequest::init_type();
130 AudioManager::init_type();
131 AudioSound::init_type();
132 NullAudioManager::init_type();
133 NullAudioSound::init_type();
137 operator << (ostream &out, FmodSpeakerMode sm) {
142 return out <<
"mono";
144 return out <<
"stereo";
146 return out <<
"quad";
148 return out <<
"surround";
153 case FSM_unspecified:
157 return out <<
"**invalid FmodSpeakerMode (" << (int)sm <<
")**";
161 operator >> (istream &in, FmodSpeakerMode &sm) {
165 if (word.size() == 0) {
166 sm = FSM_unspecified;
167 }
else if (cmp_nocase(word,
"raw") == 0) {
169 }
else if (cmp_nocase(word,
"mono") == 0) {
171 }
else if (cmp_nocase(word,
"stereo") == 0) {
173 }
else if (cmp_nocase(word,
"quad") == 0) {
175 }
else if (cmp_nocase(word,
"surround") == 0) {
177 }
else if (cmp_nocase(word,
"5point1") == 0 ||
178 cmp_nocase(word,
"5.1") == 0) {
180 }
else if (cmp_nocase(word,
"7point1") == 0 ||
181 cmp_nocase(word,
"7.1") == 0) {
185 audio_cat->error() <<
"Invalid FmodSpeakerMode value: " << word <<
"\n";
186 sm = FSM_unspecified;
This is a convenience class to specialize ConfigVariable as a Filename type.
This is a convenience class to specialize ConfigVariable as a boolean type.
This is a convenience class to specialize ConfigVariable as a floating-point type.
The name of a file, such as a texture file or an Egg file.
This is a convenience class to specialize ConfigVariable as a string type.
This class specializes ConfigVariable as an enumerated type.
This is a convenience class to specialize ConfigVariable as an integer type.