Unable to play the "audiowrite" file from the folder
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have written a downsampled wav file via audiowrite to a folder. I am able to play the sound signal in matlab using "sound(file)". However, I am unable to play it from the folder.
% Code:
Fs = 16000;
Fd=1600;
old = audioread(file);
new = resample(old, Fd, Fs);
sound(new,Fd);
audiowrite(file1, new, Fd);
2 Kommentare
Jan
am 29 Nov. 2017
Please explain what "playing from a folder" means. Maybe it matters that you use "file" and "file1"? Perhaps you forgot to specify the folder for saving? "sound(file)" does not occur in the posted code, so are you sure that this works?
Antworten (1)
Jan
am 29 Nov. 2017
Bearbeitet: Jan
am 29 Nov. 2017
It does not matter where the data are coming from. So let's narrow down the problem:
Fd = 1600;
new = 1 - 2 * rand(1, 3200);
sound(new, Fd);
audiowrite(file1, new, Fd);
If now Matlab does play the sound, but VLC does not, it is a problem of VLC. Try it:
new2 = audioread(file1);
sound(new2, Fd);
Does it work in Matlab? Then try a different external tool to play the sound. Maybe you have reduced the volume in VLC or "file1" is in a different folder than you expect it to be and you feed VLC with an old (silent) file?
0 Kommentare
Siehe auch
Kategorien
Mehr zu Audio and Video Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!