How to create a huge wav file containing multiple tracks?

2 次查看(过去 30 天)
I recorded five audio tracks (48kHz, 32bit, 1h) which I would like to write into one file with 5 channels à (48kHz, 32bit, 1h). When I simply read the tracks with audioread , I run out of memory. Using system objects didn't help as it turned out that dsp.AudioFileWriter does not allow to write more than two channels at once. Is there another technique how I could achieve that?
  1 个评论
Roman
Roman 2014-12-12
In version R2013b dsp.AudioFileWriter can handle more than 2 channels. However, if I copy one channel with the system object approach as shown below,
hafw = dsp.AudioFileWriter(RecFile,'FileFormat','WAV','SampleRate',hafr0.SampleRate);
hafr0 = dsp.AudioFileReader(PlayFile0,'SamplesPerFrame',SamplesPerFrame);
playbuff = zeros(SamplesPerFrame,5);
while ~isDone(hafr0)
playbuff(:,1) = step(hafr0);
step(hafw,playbuff);
end
I get the following error after some time:
Error using AudioFileReader/step the audio input stream has become unresponsive.
Error in combine (line 31) playbuff(:,1) = step(hafr0);
Any idea what could have gone wrong?

请先登录,再进行评论。

采纳的回答

Roman
Roman 2014-12-15
I couldn't solve the problem right in Matlab but with "SoX, the Swiss Army knife of sound processing programs" I was able to merge the tracks.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by