pycharm does not recognize mp3 file

Asked

Viewed 29 times

-1

Here glr, I was doing the python course in the video course and challenge 21 was to be able to play some mp3 in the pycharm, but when I tried to import an mp3 file it appeared here. someone knows how to solve this problem???imagem do erro

1 answer

0

The .mp3 is a binary file, not a text file, so you cannot view it in a text editor. You can open the file in a music player to check its contents or, in Python:

  1. play using the system’s standard music player using the module os:
import os
os.startfile('mm.mp3')
  1. inspect its binary content using the parameter mode of function open:
with open('mm.mp3', 'rb') as f:
    mp3_bytes = f.read()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.