OpenBve.Sounds.RegisterBuffer C# (CSharp) Метод

RegisterBuffer() статический приватный Метод

Registers a sound buffer and returns a handle to the buffer.
static private RegisterBuffer ( OpenBveApi data, double radius ) : SoundBuffer
data OpenBveApi The raw sound data.
radius double The default effective radius.
Результат SoundBuffer
		internal static SoundBuffer RegisterBuffer(OpenBveApi.Sounds.Sound data, double radius) {
			if (Buffers.Length == BufferCount) {
				Array.Resize<SoundBuffer>(ref Buffers, Buffers.Length << 1);
			}
			Buffers[BufferCount] = new SoundBuffer(data, radius);
			BufferCount++;
			return Buffers[BufferCount - 1];
		}

Same methods

Sounds::RegisterBuffer ( string path, double radius ) : SoundBuffer

Usage Example

Пример #1
0
 /// <summary>Registers a sound and returns a handle to the sound.</summary>
 /// <param name="path">The path to the file or folder that contains the sound.</param>
 /// /// <param name="radius">The sound radius</param>
 /// <param name="handle">Receives a handle to the sound.</param>
 /// <returns>Whether loading the sound was successful.</returns>
 public override bool RegisterSound(string path, double radius, out OpenBveApi.Sounds.SoundHandle handle)
 {
     if (System.IO.File.Exists(path) || System.IO.Directory.Exists(path))
     {
         handle = Sounds.RegisterBuffer(path, radius);
         return(true);
     }
     ReportProblem(OpenBveApi.Hosts.ProblemType.PathNotFound, path);
     handle = null;
     return(false);
 }
All Usage Examples Of OpenBve.Sounds::RegisterBuffer