Jump to content

what code should i add to my reminder app so that it can have audio when the reminder comes pls dont mind the English

mr.pancake

 

import time
print("What shall I remind you about?")
text = str(input())
print("In how many minutes?")
local_time = float(input())
local_time = local_time * 60
time.sleep(local_time)
print(text)
Link to comment
Share on other sites

Link to post
Share on other sites

You can import the playsound library after getting it with pip.

You can do that by going into command prompt, and typing

py -m pip install playsound

then you put the sound you want it to play in the same directory as your code.

Then just add this line to your code, replacing "YOURFILENAME" with the filename and the extension.

playsound("YOURFILENAME")

 

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean vel luctus dolor. Aliquam convallis hendrerit erat dignissim sodales. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.

 

Don't be bothered by the toxic idiots of the community. Somebody will always try to get you annoyed. The best fight is not giving them any attention. Never forget this!!

Spoiler

print("Hello World")

 

Link to comment
Share on other sites

Link to post
Share on other sites

guy i fixed it if anybody is wondering for the code it is here

 

import vlc
import time
print("What shall I remind you about?")
text = str(input())
print("In how many minutes?")
local_time = float(input())
local_time = local_time * 60
time.sleep(local_time)
sound_file = vlc.MediaPlayer("file:///Users/adeshsharma/Downloads/7120-download-iphone-6-original-ringtone-42676.mp3")
sound_file.play()
print(text)
time.sleep(30)
sound_file.stop(30)
Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×