A package for repl.it that allows you to clear the console and play audio.
Project description
Replit
Some basic tools for your repl at repl.it.
clear
def replit.clear()
replit.clear
Clear the terminal.
Audio
class replit._Audio()
Note: It is not recommended to call this directly. Instead, use import audio from replit to get an _Audio object.
play(file_path, volume=1, does_loop=False, loop_count=1)
Request for a file to be played. Returns a
Sourceobject.
volumeis the volume at which the file is to be played at.does_loop: A boolean, must beTrueif you want the file to be played more than once.loop_count: The amount of times the player should replay the file.
get_source(source_id)
Get a source by it's ID. Returns
Noneif the source wasn't found.
read_status()
Read the raw status of the audio player. It's not recommended to call this directly.
get_playing()
Get a list of playing sources. Returns a list of
Sourceobjects.
get_paused()
Get a list of paused sources. Returns a list of
Sourceobjects.
get_sources()
Get a list of all sources, playing or paused. Returns a list of
Sourceobjects.
Source
class replit.Source()
Note: It is not recommended to call this directly, instead retrieve the source via replit.audio.
path
The provided path to the file. Readonly.
id
The id of the source. Readonly.
start_time
When the audio player originally retrieved the source. Readonly.
end_time
The estimated time the source will finish playing. Readonly. Note: This does not account for the source restarting.
remaining
The estimated time remaining before the source finishes playing. Readonly. Note: This does not account for the source restarting.
duration
The estimated duration of the source. Readonly. Note: This does not account for the source restarting.
does_loop
Wether the source repeats or not. Readonly.
loops_remaining
The remaining times the source will replay. Readonly.
volume
The volume of the source. 1 is the sources native volume. This can be set to change the source's volume.
paused
Wether the source is playing or not. The source is not playing when this is
True. Set to play/pause the source.
set_loop(does_loop: bool, loop_count: int = 0)
Set the looping status of the source.
does_loop: Wether or not the file will play again.loop_count: The remaining amount of repeats the source has. Set to a negative value to repeat the source infinitely.
toggle_playing()
Toggel wether the source is playing or not.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file replit-1.1.2-py3-none-any.whl.
File metadata
- Download URL: replit-1.1.2-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e3ecc4463adfa117bb2329fcd91bd198ad79307405bdf20b8bd98671b939d47
|
|
| MD5 |
febdae68ff941df044e675c0378594c1
|
|
| BLAKE2b-256 |
10a78ce35f9b7cff4211b72f38ff612b942e268e17df3ee0e4e34083b0d7447f
|