read single channel of multi-channel wav file
21 次查看(过去 30 天)
显示 更早的评论
Hi there. I have 2- and 4-channel wav files that I need to read in to Matlab, but I only need channel 1. The files are too large to load with a single wavread. I could load in chunks, but that will require a lot of changes to the rest of the code to only deal with partial data. And this is something that is supposed to be done in a couple of days... in my spare time...
I've been searching around for awhile now, hoping that there is a simple script that someone else has come up with to read a single channel from a multi-channel wav. But so far no luck. I thought I'd ask the question, in case someone else has come across something appropriate and can steer me in the right direction.
Suggestions would be very much appreciated. Thanks so much for your help.
Michael
0 个评论
采纳的回答
Walter Roberson
2013-1-16
There is no supplied method to do this.
You can write your own routine and would not need to make many changes to your code. Call it wavread1.m or something like that. Make it a wrapper that loops reading chunks of data and throwing away the extra channels, until you get to the end.
Or if you need higher efficiency, then you will find that wavread is MATLAB source; you can trace through the parts of it that are actually used for your files, and edit those parts to not read in the extra channels (if that makes sens for the chunk) or to throw away the extra (if necessary for that kind of chunk.)
2 个评论
Walter Roberson
2013-1-16
And if you create a function that does that for you, the code change would be easy.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File 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!