read single channel of multi-channel wav file
21 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 16 Jan. 2013
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 Kommentare
Walter Roberson
am 16 Jan. 2013
And if you create a function that does that for you, the code change would be easy.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Audio I/O and Waveform Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!