【问题标题】:wavwrite outputting file with no soundwavwrite输出文件没有声音
【发布时间】:2016-02-05 12:55:09
【问题描述】:

我只是尝试使用wavwrite 输出 3 个声音文件 (.wav)。我在 MATLAB 中使用的数据使用soundsc 可以很好地播放声音,但由于某种原因,3 个声音文件中有 2 个没有任何声音。

[data,Fs] = wavread('prj1.wav'); %Data file I read in
...%filtering with cascaded FIR filter

dataFiltered = filter(Hd,data); %applying filter to data
soundsc(dataFiltered,Fs) %plays perfectly
pause(6)
wavwrite(dataFiltered,Fs,'FIR_Cascade_Signal.wav'); %writes out perfectly, can play back fine.

我的问题在此之后出现:

...%Filter with different method, simple IIR filter if curious

dataFiltered2 = filter(Gd,data); %applying second type of filter
soundsc(dataFiltered2,Fs) %plays back fine, loud and clear
pause(6)

完美播放声音

wavwrite(dataFiltered2,Fs,'IIR_Cascade_Signal.wav');%Outputted file has NO SOUND

写出声音文件,但什么也听不见

...%Filtering with notch filter. This uses dataFiltered2 as the first stage, and then filters out a 30Hz harmonic with the Notch filter

Yfilt_stage2 = filter(B,a,dataFiltered2);
soundsc(Yfilt_stage2,Fs);  %Plays loud and clear, can hear everything
wavwrite(Yfilt_stage2,Fs,'Notch_Filtered_Signal.wav');%Again, no sound in output file

任何帮助将不胜感激!

【问题讨论】:

  • 如果你用sound而不是soundsc收听会发生什么?另外,wavwrite 将在未来的版本中被删除,或许您可以考虑使用 audiowrite 代替。
  • 听起来像soundsc。我也意识到audiowrite 将取代wavewrite。现在,功能相同,都不会写出任何声音。我认为这可能只是我的计算机的问题,我正在调查它。
  • 您能否提供一个我们可以重现问题的简约示例?也许使用一些示例 WAV 文件和过滤器。另外,您是否能够通过每个阶段绘制信号并将问题隔离在wavwrite

标签: matlab audio filtering wav


【解决方案1】:

这是我电脑本身的问题。我在另一台计算机上尝试了我的代码,它运行良好。

【讨论】:

    猜你喜欢
    • 2021-07-07
    • 2018-02-25
    • 2012-06-07
    • 2022-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多