OSDN Git Service

Louder Speech volume, less tracing.
authorMojito Sorbet <mojitotech@gmail.com>
Fri, 4 Jun 2010 21:28:17 +0000 (21:28 +0000)
committerMojito Sorbet <mojitotech@gmail.com>
Fri, 4 Jun 2010 21:28:17 +0000 (21:28 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@682 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/Core/Media/BufferSound.cs
Radegast/Core/Media/Speech.cs

index 5a6c025..f84bc4c 100644 (file)
@@ -28,6 +28,8 @@
 //\r
 // $Id: Sound.cs 502 2010-03-14 23:13:46Z latifer $\r
 //\r
+// Uncomment this to get lots more logging\r
+//#define TRACE_SOUND\r
 using System;\r
 using System.Runtime.InteropServices;\r
 using System.Collections.Generic;\r
@@ -257,13 +259,14 @@ namespace Radegast.Media
 \r
                     // Allocate a channel and set initial volume.  Initially paused.\r
                     FMODExec(system.playSound(CHANNELINDEX.FREE, sound, true, ref channel));\r
+#if TRACE_SOUND\r
                     Logger.Log(\r
                         String.Format("Channel {0} for {1} assigned to {2}",\r
                              channel.getRaw().ToString("X"),\r
                              sound.getRaw().ToString("X"),\r
                              Id),\r
                         Helpers.LogLevel.Debug);\r
-\r
+#endif\r
                     lock (allChannels)\r
                         allChannels[channel.getRaw()] = this;\r
 \r
@@ -336,13 +339,13 @@ namespace Radegast.Media
                     sound.release();\r
                     sound = null;\r
                 }\r
-\r
+#if TRACE_SOUND\r
                 Logger.Log(String.Format("Removing channel {0} sound {1} ID {2}",\r
                     chanStr,\r
                     soundStr,\r
                     Id.ToString()),\r
                     Helpers.LogLevel.Debug);\r
-\r
+#endif\r
                 lock (allBuffers)\r
                     allBuffers.Remove(ContainerId);\r
 \r
index f52e74d..6c51390 100644 (file)
@@ -51,6 +51,16 @@ namespace Radegast.Media
         private Vector3 speakerPos;\r
 \r
         /// <summary>\r
+        /// If true, decrease distance falloff effect in volume.\r
+        /// </summary>\r
+        private static Boolean compress = true;\r
+        public static Boolean Compress\r
+        {\r
+            set { compress = value; }\r
+            get { return compress; }\r
+        }\r
+\r
+        /// <summary>\r
         /// Creates a new sound object\r
         /// </summary>\r
         /// <param name="system">Sound system</param>\r
@@ -135,14 +145,19 @@ namespace Radegast.Media
 \r
                         // Set general Speech volume.\r
                         //TODO Set this in the GUI\r
-                        volume = 0.8f;\r
+                        volume = 1.0f;\r
                         FMODExec(channel.setVolume(volume));\r
 \r
                         // Set attenuation limits so distant people get a little softer,\r
                         // but not TOO soft\r
-                        FMODExec(sound.set3DMinMaxDistance(\r
-                                    1.2f,       // Any closer than this gets no louder\r
-                                    8.0f));     // Further than this gets no softer.\r
+                        if (compress)\r
+                            FMODExec(sound.set3DMinMaxDistance(\r
+                                    2f,       // Any closer than this gets no louder\r
+                                    3.5f));     // Further than this gets no softer.\r
+                        else\r
+                            FMODExec(sound.set3DMinMaxDistance(\r
+                                    2f,       // Any closer than this gets no louder\r
+                                    10f));     // Further than this gets no softer.\r
 \r
                         // Set speaker position.\r
                         position = FromOMVSpace(speakerPos);\r