pip install playmedia
-
You can initiate the File class with the path of the media file as argument.
File("path/to/the/media/file")
args = None, return = string
args = [status: boolean], return = string
args = [status: boolean], return = string
args = [vol: int], defaults = [vol: 100], return = string
args = None, return = None
args = [tag: string], defaults = [tag: "Date"], return = string
args = [tag: string, new_value: string], return = string
Supported tags = Actors, Album, AlbumArtist, Artist, ArtworkURL, Copyright, Date, Description, Director, DiscNumber, DiscTotal, EncodedBy, Episode, Genre, Language, NowPlaying, Publisher, Rating, Season, Setting, ShowName, Title, TrackID, TrackNumber, TrackTotal, URL
instance = File("path/of/the/media/file/Why do I?.mp3") instance.start() # Returns Now playing Why do I? instance.pause(True) # Returns Paused instance.mute(False) # Returns Unmuted instance.set_volume(75) # Returns Volume set to 75% instance.meta("Artist") # Returns Artist: Unknown Brain instance.edit_meta("Album","playmedia") # Changed Album to playmedia instance.stop()
Note: Statements are returned not printed. To print the returned values use
print(instance.set_volume(75))
args = None, return = None
-
You can initiate the File class with either the path of the dirctory containing files or list with paths of the media files.
Files("path/to/the/dirctory/containing/media/file") or Files(["path/to/media/file/1", "path/to/media/file/2"])
args = None, return = dictionary
args = None, return = dictionary
args = [index: int], return = string
args = [status: boolean], return = string
args = None, return = string
args = None, return = string
args = [status: boolean], return = string
args = [vol: int], defaults = [vol: 100], return = string
args = None, return = None
args = [tag: string], defaults = [tag: "Date"], return = string
Note: A media should be playing when this method is called. Either call start(), play_at_index(index) before otherwise it raises a IndexError.
Supported tags = Actors, Album, AlbumArtist, Artist, ArtworkURL, Copyright, Date, Description, Director, DiscNumber, DiscTotal, EncodedBy, Episode, Genre, Language, NowPlaying, Publisher, Rating, Season, Setting, ShowName, Title, TrackID, TrackNumber, TrackTotal, URL
args = None, return = dictionary
instance = File("path/to/the/dirctory/containing/media/file") instance.get_list() # Returns {0: 'File 1.mp3', 1: 'File 2 .mp4', 2: 'File 3.wav'} instance.start() # Returns {0: 'File 1.mp3', 1: 'File 2 .mp4', 2: 'File 3.wav'} instance.stop() instance.play_at_index(1) # Returns Now playing File 2 instance.pause(True) # Returns Paused instance.mute(False) # Returns Unmuted instance.set_volume(75) # Returns Volume set to 75% instance.current_meta("Artist") # Returns Artist: "Artist of File 2" instance.current_time("Album","playmedia") # Returns {"Current time": '98.63s'}
Note: Statements are returned not printed. To print the returned values use
print(instance.set_volume(75))
- '.m4a'
- '.flac'
- '.mp3'
- '.mp4'
- '.wav'
- '.wma'
- '.aac'
- '.mkv'
Contributions, issues and feature requests are welcome! Feel free to check issues page.
Give a ⭐️ if this project helped you!!