Posts: 1
Joined: Wed Jun 16, 2021 8:22 am

Play sound Python

Wed Jun 16, 2021 8:26 am

Hello everyone,

I'm trying to create a door sensor on the Raspberry Pi,
But i can't figure out how to do this...

I want to play an mp3 file when distance < 12
Does anyone know what code i need to use for this?
I cant find anything on the internet...


Posts: 11312
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Play sound Python

Wed Jun 16, 2021 7:01 pm


You have not said what sensor you intend to use, so how can we point you at suitable code.

I suggest you do a search for which ever sensor you intend to use and how to connect it to you pi most examples will probably include example code.

If you do a web search like this you will find lots of examples of how to play MP3 files.

" how to play mp3 file on pi using python "
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Return to “Python”