How to read audio file from google cloud storage bucket and play with ipd in a datalab notebook
问题 I want to play a sound file in a datalab notebook which I read from a google cloud storage bucket. How to do this? 回答1: import numpy as np import IPython.display as ipd import librosa import soundfile as sf import io from google.cloud import storage BUCKET = 'some-bucket' # Create a Cloud Storage client. gcs = storage.Client() # Get the bucket that the file will be uploaded to. bucket = gcs.get_bucket(BUCKET) # specify a filename file_name = 'some_dir/some_audio.wav' # read a blob blob =