How to create a huge wav file containing multiple tracks?

조회 수: 2 (최근 30일)
Roman
Roman 2014년 12월 12일
답변: Roman 2014년 12월 15일
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