Skip to content

Instantly share code, notes, and snippets.

View P4UL-M's full-sized avatar
:octocat:

Paul Mairesse P4UL-M

:octocat:
  • EFREI Paris
  • Paris
  • 07:41 (UTC +01:00)
View GitHub Profile
@P4UL-M
P4UL-M / README.md
Last active April 25, 2024 18:15
Changing playback sound speed in realtime with python and multiprocessing

Changing playback sound speed in realtime with python and multiprocessing

This is a script to change the sound speed in real time like for example background music in pygame.

The script generates the raw data of a sound file each time there is space in the queue. The sample will scale to the desired speed which you can modify with sound_Factor.

To play the music, you just need to get buffers from the queue and pass them to your music stream. Exemple for pygame :

# musique update
if channel.get_queue() == None:
@P4UL-M
P4UL-M / READ ME.md
Last active June 10, 2025 13:14
Send Discord private message to a friend with Siri

Here is how I did a program to send private message on Discord with Siri,

For that I use the Discord API for python which is normally used to control a bot but which I used to control my Discord account.Thanks to that I could send message on discord with an simple python script. For that you must run the bot with your discord account's token and add Bot=False when you launch the client with yourBot.run("your Tokken", bot = False. To get you discord account's token you just need to find it in the navigator windows on any search browser.

Then I use 3 ios apps to add it to Siri:

  • Shortcuts
  • LibTerm
  • Scriptable

LibTerm is a free app that provides access to a command terminal. With that you can execute any python script on your phone and install and import libraries like Discord.py. Also it give you a block in Shorcuts to run any command.