Forum Archive

Importing sound files

newtoonie

I'm creating a game on pythonista and wondering, how can import custom sound files?
I hear I can use the Dropbox API (never done something like this before)
Will this allow me to import sound files?

lukaskollmer

You could host the file on a web server and use urllib.urlretrieve to download the file.

Example:

import urllib.request
urllib.request.urlretrieve ("http://www.example.com/songs/mp3.mp3", "mp3.mp3")
ccc

The Cloud Jump game pulls sounds off the internet... https://github.com/Pythonista-Tools/Pythonista-Tools/blob/master/Games.md