Giter Site home page Giter Site logo

audioplayer's Introduction

AudioPlayer

Built-in audio player, with full access to the settings of the user and the developer. Support for Internet resources.

Installation

Install nuget package here

Usage

  1. Create an element in xml
<Window
    xmlns:AudioPlayer="clr-namespace:AudioPlayer;assembly=AudioPlayer">
    <Grid>
        <AudioPlayer:Player Name="CustomPlayer"/>
    </Grid>
</Window>
  1. Create a playlist and add to player
Playlist list = new Playlist(new List<Music>
            {
                new Music {source = new Uri(directory + "audioTest/Artik.mp3"), name = "Artik 2.0"},
                new Music {source = new Uri(directory + "audioTest/Rasa.mp3"), sourceImg = new Uri("https://avatars.mds.yandex.net/get-zen_doc/1591494/pub_5d05c6ad97d1910df850692d_5d05daefcf474f0da0398c8f/scale_1200")},
                new Music {source = new Uri(directory + "audioTest/MATRANG.mp3")},
                new Music {source = new Uri(directory + "audioTest/Rakhim.mp3"), name = "Dance", sourceImg = new Uri(directory + "imgTest/slon.jpg")},
            });
CustomPlayer.SetPlayList(list);

OR one music

CustomPlayer.SetMusic(new Music {source = new Uri(directory + "audioTest/Artik.mp3"), name = "Artik 2.0"});

Others methods

Parameters

CustomPlayer.StyleBackground // Main color the Audio player

Event

CustomPlayer.MusicStart // Event when the track starts playing
CustomPlayer.MusicEnded // Event at the end of track playback

Playback control

CustomPlayer.SetPlayList(Playlist) // Sets a playlist and plays it back
CustomPlayer.SetMusic(Music) // Set a Music and play it back
CustomPlayer.Stop() // Stop play music
CustomPlayer.Play() // Run play music
CustomPlayer.SetVolume(int) // Set volume music (volume from 0 to 1)
CustomPlayer.MuteVolume(bool) // Mute or unmute
CustomPlayer.IsMuteVolume():bool // Is mute install
CustomPlayer.StartRandom() // Enables shuffle playlist
CustomPlayer.StopRandom() // Disables shuffle playlist
CustomPlayer.StartReplay() // Enables music replay
CustomPlayer.StopReplay() // Disables music replay
CustomPlayer.NextMusic() // Play next music
CustomPlayer.LastMusic() // Play last music
CustomPlayer.getNowMusicIndex():int // Get number play music
CustomPlayer.getNowMusic():Music // Get number play music
CustomPlayer.PickNumberMusic_PlayList(int) // Play music under the number (index from scratch)
CustomPlayer.PickMusic_PlayList(Music) // Play music if in playlist

Manage playlist

CustomPlayer.AddMusic_PlayList(Music) // Add music to a playlist
CustomPlayer.RemoveMusic_PlayList(Music) // Delete music from a playlist

Class

Music

Uri source // The path to music
string name // Music name
Uri sourceImg // The path to image

Playlist

string name; // Playlist name

getMusics() // Return music list
Add(Music) // Add music to the playlist
Del(Music) // Delete music to the playlist
SetIndex(int):bool // Sets the playing music by index
SetMusic(Music):bool // Sets the playing music
RandomPlayList() // Shuffles the playlist
StandartPlayList() // Sets the original playlist
Next():Music? // Switches to the next music
Last():Music? // Switches to the last music
IsNextMusic():bool // Is there next music
IsLastMusic():bool // Is there last music
getIndex():int // Index of the playing music
getNow():Music // Returns the music playing now

An example of the application can be viewed here

audioplayer's People

Contributors

stounhandj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.