Unable to play the "audiowrite" file from the folder
9 次查看(过去 30 天)
显示 更早的评论
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 个评论
Jan
2017-11-29
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?
回答(1 个)
Jan
2017-11-29
编辑:Jan
2017-11-29
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!