How to read Audio File into Vector?

6 visualizzazioni (ultimi 30 giorni)
dieter alfred
dieter alfred il 15 Lug 2020
Commentato: bob bob il 21 Dic 2024
Hello, I have to read a Audio File (.wav) into a vector.
I know how to plot it:
info = audioinfo('sound.wav');
[y, Fs] = audioread('sound.wav');
t = 0:1/Fs:info.Duration;
t = t(1:end-1);
plot(t,y);
xlabel('Time');
ylabel('Audio Signal');
But this Sript does not read the Audio into a Vector.
I also tried to read every single Sample, but this is to complex and I get error after error. Is there a simple way to do this?
  2 Commenti
Cris LaPierre
Cris LaPierre il 15 Lug 2020
It would be helpful if you could share the error messages as well as your sound.wav file.
dieter alfred
dieter alfred il 15 Lug 2020
Sorry, I cannot upload the file, because the forum doesnt accept the .wav filetype. And I have already deleted the code with the error messages. But next time I will upload everything.

Accedi per commentare.

Risposta accettata

Sugar Daddy
Sugar Daddy il 15 Lug 2020
Modificato: Sugar Daddy il 15 Lug 2020
[y, Fs] = audioread('sound.wav');
sound_duration = length(y)/Fs;
t = 0:1/Fs:sound_duration;
t = t(1:end-1);
%%
soundsc(y,Fs);
%%
plot(t,y);
xlabel('Time');
ylabel('Audio Signal');
  2 Commenti
dieter alfred
dieter alfred il 15 Lug 2020
Thank you very much for your answer.
bob bob
bob bob il 21 Dic 2024
Any idea on how to reduce the # of points? I am trying to get the SVG to use in a graphic design setting so I will be altering the shape more in Illustrator but I would like to reduce the point by quite a bit

Accedi per commentare.

Più risposte (2)

George james
George james il 6 Giu 2022
The help slides is providing the facility for a training program that has been producing high-quality audio. The https://www.resumesplanet.com/linkedin-profile-writing.php is quite a good option to get admission to these training programs.

Charlotte Oliver
Charlotte Oliver il 10 Giu 2022
Modificato: Charlotte Oliver il 10 Giu 2022
there is alot of mistakes in this specific code for the correct program just visit this one https://consumeratings.com/ It will provide you the best code moreover correct your mistakes as well. happy to help you all.

Categorie

Scopri di più su Measurements and Spatial Audio in Help Center e File Exchange

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by