The steps as follows: Uploading the silk file to your server. Decoding the silk file. Thanks to this project, this is an awesome tool for decoding the silk file to pcm format. File is being exported and saved to a new path. Now we have to use the django File instance to read the file that we have just exported: converted_audiofile = File (. file=open (new_path, 'rb Hi all, In my application i want to convert audio file which is in the form of .amr file to .wav file using c#. How to do that? Thanks in advance. Speech recognition supports WAV file format. Here is a sample MP3 to text program using speech_recognition. import speech_recognition as sr from pydub import AudioSegment r = sr.Recognizer() #convert mp3 to wav sound = AudioSegment.from_mp3("recording.mp3") sound.export("recording.wav", format="wav") temp = 'recording.wav' with sr.AudioFile(temp) as source: audio = r.record(source) text = r Basically it could be that you're missing a dependency, here's what the pydub docs say: You can open and save WAV files with pure python. For opening and saving non-wav files – like mp3 – you'll need ffmpeg or libav. – You can modify it further if you need more channels or a different sample width. import wave import struct def signal_to_wav (signal, fname, Fs): """Convert a numpy array into a wav file. Args ---- signal : 1-D numpy array An array containing the audio signal. fname : str Name of the audio file where the signal will be saved. ftransc -f ogg filename.mp3 The output file name for the above example will be 'filename.ogg' Example 2 - converting from MP3 to AAC, removing original file on success, using high quality preset: ftransc -r -q extreme -f aac filename.mp3 Example 3 - extract audio content from a video files into the MP3 format, use best quality preset: 1 Answer. I found a solution that works, as suggested by @ForamJ in the comment, however it took me 30mins to convert 1min audio. # step1 - converting a wav file to numpy array and then converting that to mel-spectrogram my_audio_as_np_array, my_sample_rate= librosa.load ("audio1.wav") # step2 - converting audio np array to spectrogram spec 1. I've tried many things to open and convert an audio file into a numpy array but nothing works. import numpy as np import pyglet song = pyglet.media.load ('sample-000000.mp3') np.array (song) I want an array of numbers, not an array containing a pyglet file. Out [1]: array (v1xD.

how to convert mp3 to wav in python