#πŸ”’ I need help with python on phone

54 messages Β· Page 1 of 1 (latest)

neon crow
#

I want to run Python code on my phone and play audio or sound. For example, when an event or function occurs, it should play a beep sound. The main problem is that I’m not sure which library to use.

sturdy horizonBOT
#

@neon crow

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

neon crow
#

If you need more context, just ask

keen cosmos
#

@neon crow pulseaudio isn't it

neon crow
rugged vessel
# neon crow I want to run Python code on my phone and play audio or sound. For example, when...

https://realpython.com/playing-and-recording-sound-python/
it lists a few simple and advanced libraries for playing sound. note that for newer python versions some modules (like playsound) might not install properly

In this tutorial, you'll learn about libraries that can be used for playing and recording sound in Python, such as PyAudio and python-sounddevice. You'll also see code snippets for playing and recording sound files and arrays, as well as for converting between different sound file formats.

keen cosmos
#

@neon crow what are you trying to do exactly

#

Android is my thing

neon crow
neon crow
keen cosmos
#

What cli are u using

#

U got a Linux cli on ur phone now

#

There is lots of libraries but it depends on what u use to call them up @neon crow

#

To create the beep noise I just used these

import time

def play_beep(frequency=1000, duration=0.1):
    subprocess.run(['termux-bell'], capture_output=True)
    time.sleep(duration)

def main():
    while True:
        user_input = input()
        if user_input == "":
            play_beep()

if __name__ == "__main__":
    main()```
neon crow
keen cosmos
#

I would use other for audio though

#

Why don't u get it

#

Android allows u to access what shell

#

Or ur using the playstore and like Shellix

neon crow
keen cosmos
#

Yeah I would not use that why don't you go to httos://fdroid.org
Then install and download termux

#

Then u can ur in a better position

#

And dow load termux api since u want to access the internal system u need to use termux-api

#

I have rootkits for you I u need but u don't have to root

#

U can use Docker to bypass root

neon crow
keen cosmos
#

Yeah idk how this is the shortest way I know how from command line

#

I am the one who rewrote and fixed the broken pip so I push it when I can

neon crow
#

im not trying to use command line, i want the beep to play form pythpn

keen cosmos
#

How are u accessing python thru the terminal pyshell

#

How thru adb shell are u accessing it ur not root

#

Therefore u need to either reverse ur own device or use api

neon crow
#

im not accessing python thru the terminal pyshell (i dont understand this btw)
i can run a normal print and that type of stuff btw

keen cosmos
#

Yeah ur gonna work for that lady

#

It's not compatible with the api

#

U need to configure and now ur coding

#

Should of used termux instead ofpydroid3

neon crow
#

i just need a library that works on pyone

#

does termux run python code?

keen cosmos
#

Yes

#

I use it to hack stuff

#

I make alot of stuff for android hackers

neon crow
# keen cosmos Yes

Do i have to set the file every time, like can i load from a file or nah?

keen cosmos
#

U can but u need to use termux boot

neon crow
#

can i just use the termux from the playstore?

keen cosmos
#

No

#

U need fdroid termux is discontinued after python3 launched all the libs got mashed

#

I spent a long time fixing it

#

Some wheels are still effed

#

Pynacl is one there are few i have work around for them all

neon crow
#

So why cant i just use pydroid, and find a good library

sturdy horizonBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.