Created
January 3, 2023 17:17
-
-
Save bbenetskyy/61cc6facc06a16c118027ac56f8c5bce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Sound Service | |
/// </summary> | |
public interface ISoundService | |
{ | |
/// <summary> | |
/// Play Embedded Sound from Resources | |
/// Usage example: ISoundService.PlaySound("success.mp3"); | |
/// </summary> | |
/// <param name="sound">sound resource name with extension</param> | |
void PlaySound(string sound); | |
} | |
public partial class SoundService : ISoundService | |
{ | |
public void PlaySound(string sound) | |
{ | |
#if ANDROID | |
PlayAndroidSound(sound); | |
#elif IOS | |
PlayIosSound(sound); | |
#endif | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment