Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

[Resonance] AudioPlayer API #2743

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Exiled.API/Exiled.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
</Reference>
<Reference Include="Assembly-CSharp-firstpass" HintPath="$(EXILED_REFERENCES)\Assembly-CSharp-firstpass.dll" Private="false" />
<Reference Include="CommandSystem.Core" HintPath="$(EXILED_REFERENCES)\CommandSystem.Core.dll" Private="false" />
<Reference Include="Pooling" HintPath="$(EXILED_REFERENCES)\Pooling.dll" Private="false" />
<Reference Include="Mirror" HintPath="$(EXILED_REFERENCES)\Mirror.dll" Private="false" />
<Reference Include="Pooling" HintPath="$(EXILED_REFERENCES)\Pooling.dll" Private="false" />
<Reference Include="NVorbis" HintPath="$(EXILED_REFERENCES)\NVorbis.dll" Private="false" />
<Reference Include="NorthwoodLib" HintPath="$(EXILED_REFERENCES)\NorthwoodLib.dll" Private="false" />
<Reference Include="PluginAPI" HintPath="$(EXILED_REFERENCES)\PluginAPI.dll" Private="false" />
<Reference Include="System.ComponentModel.DataAnnotations" />
Expand Down
73 changes: 73 additions & 0 deletions Exiled.API/Features/Audio/AudioFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// -----------------------------------------------------------------------
// <copyright file="AudioFile.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Features.Audio
{
using System.ComponentModel;

using VoiceChat;

/// <summary>
/// Represents an audio file that can be used by the <see cref="AudioPlayer"/>.
/// </summary>
public class AudioFile
{
/// <summary>
/// Initializes a new instance of the <see cref="AudioFile"/> class.
/// </summary>
public AudioFile()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AudioFile"/> class.
/// </summary>
/// <param name="filePath"><see cref="FilePath"/>.</param>
/// <param name="isEnabled"><see cref="IsEnabled"/>.</param>
/// <param name="isLooping"><see cref="IsLooping"/>.</param>
/// <param name="volume"><see cref="Volume"/>.</param>
/// <param name="channel"><see cref="Channel"/>.</param>
public AudioFile(string filePath, bool isEnabled = true, bool isLooping = false, int volume = 100, VoiceChatChannel channel = VoiceChatChannel.Intercom)
{
FilePath = filePath;
IsEnabled = isEnabled;
IsLooping = isLooping;
Volume = volume;
Channel = channel;
}

/// <summary>
/// Gets or sets the path to the audio file.
/// </summary>
[Description("Indicates the location of the audio file.")]
public string FilePath { get; set; }

/// <summary>
/// Gets or sets a value indicating whether this audio file is enabled or not.
/// </summary>
[Description("Indicates if the audio file is enabled or not.")]
public bool IsEnabled { get; set; }

/// <summary>
/// Gets or sets a value indicating whether if the audio that is being played should be looped or not.
/// </summary>
[Description("Indicates if the audio file that is being played should be looped or not.")]
public bool IsLooping { get; set; }

/// <summary>
/// Gets or sets value the volume of the audio.
/// </summary>
[Description("The volume of the audio file.")]
public int Volume { get; set; }

/// <summary>
/// Gets or sets the <see cref="VoiceChatChannel"/> of the <see cref="AudioPlayer"/>.
/// </summary>
[Description("The Voice Channel of the AudioPlayer.")]
public VoiceChatChannel Channel { get; set; }
}
}
Loading
Loading