PureAspiration
@PureAspiration
I code using Python and Java.
I want to play this audio file but it's not working and it says "TimeoutError: Source was not created within 2 seconds."
Python
PattanAhmed @PureAspiration Hi,
Yes, you can use audio on Repl.it (Python)
It has been going very easy feature...
Here is the official doc:-
https://docs.repl.it/repls/audio
This doc provides a step-by-step tutorial on how to use audio on Repl.it (with Python too)
Make sure that this feature is in BETA version which means that it has some fewer features.
That's it
Thanks!
Hope this helps2 years ago
Coder100 Repl.it can't play audio. You will have to use their API:
here
Be sure to turn on explorer mode as well!
This is because they run their files on a virtual machine, so they can't really interact with your computer (use webcam, use mic, etc)\
from replit import audio
def main():
source = audio.play_file('audio.wav')
volume = 1
loops = 0
print('type "up" or "down" to change volume')
print('type "loop" to add another loop')
print('press enter to play/pause')
while True:
print(f'volum2 years ago
realTronsi Just an FYI, all files are run on repl's side (virtual machine whatnot), so audio files won't play unless you're using HTML.2 years ago
So I wanted to make a game, but I'm not sure how to save the player's level into a file with their usernames. Can someone show me how to do that?
Tha
PattanAhmed @PureAspiration Hi,
You can use something called Database
There are many databases such as Mongo, etc
But I suggest you use Repl DB
For the tutorial, you can find that on your Repl:-
01
Additional:-
https://docs.repl.it/misc/database
That's it
Thanks!
Hope this helps2 years ago
Coder100 Repl.it db
It's the easiest choice ig
Docs https://pypi.org/project/replit/
But please do note that no database will work on repl.it's terminal because of security things, so unless you want to make the database public, it will be very hard to make it work on the terminal.
Short example:
from replit import db
db[input('username')] = { password: input('password'), score: 0 }
`2 years ago
heyitsmarcus I made a simple little Python script that commits a value to Repl's DB in Python, and I added a bunch of comments. If you have any questions, feel free to ask: https://repl.it/@heyitsmarcus/Use-ReplDB-in-Python#main.py2 years ago