I have some mp3 files that I need to convert to wav (to use a recognition service that only supports wav). If I were on my local computer I would use the solution of:
from pydub import AudioSegment
sound = AudioSegment.from_mp3("02_Not_Work_AudioFile.mp3")
sound.export("pepe.wav", format="wav")
but in this case the data is in an Azure container, and the way to access it is by reading it through Spark.
full_path = path_to_file.mp3
input_df = spark.read.format("binaryFile").load(full_path)
pandas_df = input_df.toPandas()
content = pandas_df['content'][0] # here is my binary
Sending the binary data to the speech-translation service from Microsoft would not work as it only accept wav. So somehow I have to transform that binary to wav.
Does anyone knows how ?