[PYTHON] How to convert a mel spectrogram back to a wav file

Revert the mel spectrogram to the original .wav file

import numpy as np
import librosa

#Read melpectogram of npy file
mel = np.load("melspe.npy")

#mel -> audio
audio = librosa.feature.inverse.mel_to_audio(mel)

#Export wav
librosa.output.write_wav("audio.wav",audio,22050)

Afterword

I had a chance to use it, but I couldn't find an article, so I wrote it. I hope it's okay ... not L ... please do something about it

Recommended Posts

How to convert a mel spectrogram back to a wav file
How to create a config file
[Python] How to convert db file to csv
[Python] How to convert a 2D list to a 1D list
How to convert Python to an exe file
How to read a CSV file with Python 2/3
How to convert m4a acquired by iTunes to wav
How to create a JSON file in Python
How to read a file in a different directory
How to convert / restore a string with [] in python
Convert a text file with hexadecimal values to a binary file
How to convert JSON file to CSV file with Python Pandas
How to turn a .py file into an .exe file
How to convert Json file to CSV format or EXCEL format
How to call a function
Upload a file to Dropbox
Convert genbank file to gff file
How to convert an array to a dictionary with Python [Application]
How to run a Python file at a Windows 10 command prompt
How to import a file anywhere you like in Python
How to use a file other than .fabricrc as a configuration file
[Python] How to output a pandas table to an excel file
How to write a Python class
Creating a wav file split program
Convert A4 PDF to A3 every 2 pages
How to make a slack bot
How to create a Conda package
Write standard output to a file
How to make a command to read the configuration file with pyramid
How to make a crawler --Advanced
How to make a recursive function
How to create a virtual bridge
How to output the output result of the Linux man command to a file
[Python] How to store a csv file as one-dimensional array data
How to convert Tensorflow model to Lite
How to make a deadman's switch
How to create a Dockerfile (basic)
[Blender] How to make a Blender plugin
Convert a string to an image
How to delete a Docker container
How to create a CSV dummy file containing Japanese using Faker
How to make a crawler --Basic
How to convert from .mgz to .nii.gz
A tool to convert Juniper config
[ROS2] How to play a bag file with python format launch
[Python] How to extract / delete / convert a matrix containing missing values (NaN)
How to specify a .ui file in the dialog / widget GUI in PySide
I want to convert a table converted to PDF in Python back to CSV
How to put a line number at the beginning of a CSV file
How to create a clone from Github
How to split and save a DataFrame
How to easily convert format from Markdown
How to build a sphinx translation environment
How to create a git clone folder
Qiita (1) How to write a code name
How to add a package with PyCharm
[Python] How to make a class iterable
How to draw a graph using Matplotlib
[Python] Convert csv file delimiters to tab delimiters
Convert psd file to png in Python
[Colab] How to copy a huge dataset