Answer the question
In order to leave comments, you need to log in
How to translate a piece of Python3 code into C++?
There is a function that returns information about an mp3 file
def getTagValue(path, name):
with open(path, "rb") as file:
file.seek(-128, 2)
if file.read(3).decode("cp1251") == 'TAG':
title = file.read(30).decode("cp1251")
artist = file.read(30).decode("cp1251")
album = file.read(30).decode("cp1251")
year = file.read(4).decode("cp1251")
comment = file.read(30).decode("cp1251")
if name == "title":
return title
elif name == "artist":
return artist
elif name == "album":
return album
elif name == "year":
return year
elif name == "comment":
return comment
else:
return
char* getTagValue(char* path, char* name){
file = fopen(path, "rb");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question