Skip to content

Instantly share code, notes, and snippets.

@BlogBlocks
Last active July 18, 2018 03:34
Show Gist options
  • Select an option

  • Save BlogBlocks/e259312d9c23795197d8b2822c6d77c1 to your computer and use it in GitHub Desktop.

Select an option

Save BlogBlocks/e259312d9c23795197d8b2822c6d77c1 to your computer and use it in GitHub Desktop.
# Playing the Binary Music File
# the player for the storebinary music
import sqlite3
def extract_binary(cursor, picture_id):
sql = "SELECT binaryD, TYPE, FILE_NAME FROM Binaries WHERE id = :id"
param = {'id': picture_id}
cursor.execute(sql, param)
ablob, ext, afile = cursor.fetchone()
filename = afile + ext
with open(filename, 'wb') as output_file:
output_file.write(ablob)
return filename
#conn = create_or_open_db('MP3/music.db')
conn = sqlite3.connect('MP3/junk4.db')
cur = conn.cursor()
filename = extract_binary(cur, 4)
cur.close()
conn.close()
print filename
from GISTstore import Pmp3
Pmp3.pmp3(filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment