jameslyons / python_speech_features

This library provides common speech features for ASR including MFCCs and filterbank energies.
MIT License
2.38k stars 617 forks source link

ValueError: File format b'OggS'... not understood. #94

Closed ShasV05 closed 4 years ago

ShasV05 commented 4 years ago

idk why i get this issue this is my code

from` scipy.io import wavfile
import scipy.signal as sps

# Your new sampling rate
new_rate = 16000
# Read file
sampling_rate, data = wavfile.read('Sounds/listening.mp3')

number_of_samples = round(len(data) * float(new_rate) / sampling_rate)
data = sps.resample(data, number_of_samples)
jameslyons commented 4 years ago

The error is coming from scipy, not python_speech_features, you need to provide a wav formatted file to the wavfile reading function, not mp3.

On Mon, 13 Jul 2020, 12:05 am shashank333, notifications@github.com wrote:

idk why i get this issue this is my code

from` scipy.io import wavfile import scipy.signal as sps

Your new sampling rate

new_rate = 16000

Read file

sampling_rate, data = wavfile.read('Sounds/listening.mp3')

number_of_samples = round(len(data) * float(new_rate) / sampling_rate) data = sps.resample(data, number_of_samples)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jameslyons/python_speech_features/issues/94, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM7KQJKINRUU4Q4E5XJWYDR3G7JNANCNFSM4OX2DP3A .

ShasV05 commented 4 years ago

ok 👍