I’ve developed an interactive version of the Ongoing Reading Project (ORP) for Job Koelewijn, enabling spectators to listen to the text for the first time. The Ongoing Reading Project entails a daily 45-minute reading session, chronicled since February 1, 2006, where various literary works are read aloud and recorded.
Now, spectators can effortlessly scan the QR codes from the panels and delve into the audio experience of the ORP. This novel approach breaks new ground in accessibility, making literature more engaging and accessible to all.
Currently, Job and I are working on creating a comprehensive book containing all the books from the ORP. Each page of the book will feature the QR codes of one book. I’m responsible for curating all metadata of the read books, which I meticulously organize using a Python program. This program converts the metadata into a PDF containing QR codes, which then link to the web server housing all the audio files.
# Loop through files in the directory to find the .nfo file containing metadata
for file in os.listdir(self.path):
if file.endswith(".nfo"):
# Construct the path to the .nfo file
nfopath = os.path.join(self.path, file)
# Create an element tree object from the .nfo file
tree = ET.parse(nfopath)
# Get the root element of the XML tree
root = tree.getroot()
# Extract the title, author, and genre metadata
self.title = root.find('title').text
self.author = root.find('artist').text
self.relief = root.find('genre').text
# Loop through files in the directory to find audio files with supported extensions
for file in os.listdir(self.path):
if file.endswith(".mp3") or file.endswith(".flac") or file.endswith(".mp4") or file.endswith(".wav"):
# Construct the path to the audio file
trackpath = os.path.join(self.path, file)
# Extract metadata from the audio file using Taglib
with taglib.File(trackpath, save_on_exit=False) as track:
self.bookNo = track.tags["DISCNUMBER"][0]
self.published = track.tags["DATE"][0]
# Loop through audio files again to generate QR codes and extract additional metadata
for file in os.listdir(self.path):
if file.endswith(".mp3") or file.endswith(".flac") or file.endswith(".mp4") or file.endswith(".wav"):
# Construct the path to the audio file
trackpath = os.path.join(self.path, file)
# Generate QR code for the audio file
self.getQrCode(self.title, self.author, file)
print('QRCODE')
# Extract track-specific metadata from the audio file using Taglib
with taglib.File(trackpath, save_on_exit=False) as track:
no = track.tags["TRACKNUMBER"][0]
no = int(no.split('/')[0])
pages = track.tags["TITLE"][0]
date = track.tags["RELEASEDATE"][0]
date = date.split('T')
date = datetime.strptime(date[0], '%Y-%m-%d')
date = date.strftime("%-d %b %Y")
time = track.length # Duration is in seconds
# Store the extracted metadata in a dictionary indexed by track number
self.tracks[no] = Track(pages, date, time)
# Sort the tracks dictionary by track number
self.tracks = dict(sorted(self.tracks.items()))
Using Taglib in Pythin to extract metadata from audio files