Michsky – Docs Michsky – Docs
  • Home 
  • Documentation 
    • Hex UI 
    • Beam UI 
    • Reach UI 
    • Heat UI 
    • DreamOS 
    • Modern UI Pack 
    • Loading Screen Studio 
    • Dark UI 
    • Motion Titles Pack 
  • Contact 
Michsky – Docs Michsky – Docs
Michsky – Docs
  • Home 
  • Documentation 
    • Hex UI 
    • Beam UI 
    • Reach UI 
    • Heat UI 
    • DreamOS 
    • Modern UI Pack 
    • Loading Screen Studio 
    • Dark UI 
    • Motion Titles Pack 
  • Contact 

DreamOS

  • Quick Start
  • Animations
  • Apps & Windows
    • App Library
    • Creating New Apps
    • Commander
    • Game Hub
    • Mail
    • Messaging
    • Music Player
    • Notepad
    • Photo Gallery
    • Reminder
    • Settings
    • Video Player
    • Web Browser
    • Widget Library
  • Handlers & Managers
    • Audio Manager
    • Boot Manager
    • Data Manager
    • Date & Time
    • Events
    • Mod Manager
    • Multi Instance Manager
    • Network Manager
    • Notification Manager
    • User Manager
    • World Space Manager
    • Window Manager
    • Wallpaper Manager
  • Localization
    • Getting Started
    • Localization Settings
    • Localization Manager
    • Localized Object
  • UI Elements
    • Button
    • Context Menu
    • Modal Window
    • Selectors
    • Slider
    • Switch
  • UI Manager
  • Others & Add-ons
    • Steam Messaging
  1. Home
  2. DreamOS
  3. Apps & Windows
  4. Music Player
Updated on July 4, 2023

DreamOS

  • Quick Start
  • Animations
  • Apps & Windows
    • App Library
    • Creating New Apps
    • Commander
    • Game Hub
    • Mail
    • Messaging
    • Music Player
    • Notepad
    • Photo Gallery
    • Reminder
    • Settings
    • Video Player
    • Web Browser
    • Widget Library
  • Handlers & Managers
    • Audio Manager
    • Boot Manager
    • Data Manager
    • Date & Time
    • Events
    • Mod Manager
    • Multi Instance Manager
    • Network Manager
    • Notification Manager
    • User Manager
    • World Space Manager
    • Window Manager
    • Wallpaper Manager
  • Localization
    • Getting Started
    • Localization Settings
    • Localization Manager
    • Localized Object
  • UI Elements
    • Button
    • Context Menu
    • Modal Window
    • Selectors
    • Slider
    • Switch
  • UI Manager
  • Others & Add-ons
    • Steam Messaging

Music Player

Author: admin 286 views

Workflow

Functional music player app which supports essential player features, including playlists, shuffle, repeat and so on.

Music Player app depends on its manager and scriptable objects. It supports multiple playlists which you can manage using the manager component. You can add new music items using Tools > DreamOS > Select Music Library. All playlists and items will be generated at runtime.

Fetch Music Data

If you want to apply the music data to an object (such as cover art), you can add the ‘Music Player Data Item’ component to your image or TMP objects.

Scripting

				
					using UnityEngine;
using Michsky.DreamOS; // DreamOS namespace

public class SampleClass : MonoBehaviour
{
    [SerializeField] private MusicPlayerManager musicPlayer; // App variable

    void YourFunction()
    {
        // Set playback
        musicPlayer.Play();
        musicPlayer.Pause();
        musicPlayer.Stop();
        musicPlayer.PrevTrack();
        musicPlayer.NextTrack();
        musicPlayer.Mute();

        // Set shuffle and repeate state
        musicPlayer.shuffle = true;
        musicPlayer.repeat = false;

        // Play custom music
        musicPlayer.PlayCustomClip(AudioClip clip, Sprite cover, "Clip Name", "Author");

        // Get values
        int duration = musicPlayer.GetDuration();
        string normalizedDuration = musicPlayer.GetNormalizedDuration();
        int playTime = musicPlayer.GetPlayTime();
        string normalizedPlayTime = musicPlayer.GetNormalizedPlayTime();
        Sprite cover = musicPlayer.GetCoverArt();
        string track = musicPlayer.GetTrackName();
        string artist = musicPlayer.GetArtistName();
        string album = musicPlayer.GetAlbumName();
    }
}				
			

How can we help?

A premium WordPress theme with an integrated Knowledge Base,
providing 24/7 community-based support.

© 2024 Michsky