audio extraction from individual/selective data column.
古いコメントを表示
Would be glad if someone could help me with this question.
In my 'data', there are two columns. I am trying to run the code below on only the second column and extract it's data to replace with the original data (with both coloumns).

If I just purely run the below code, the script will run on the first column,
how do I choose the second column, or insert data (:,end) to this working code?
[data,samp_rate] = audioread(Audio_files(p).name);
%% equations worked on the audio file and get s, the new starting point of the audio
startSample = s;
endSample = length(data);
extractedData = data(startSample:endSample);
extractedData(1:2*samp_rate ) = [];
audiowrite(Audio_files(p).name '.m4a', extractedData,samp_rate );
I tried inserting data(:,end) like how it is written below, but it aint working.
[data,samp_rate] = audioread(Audio_files(p).name);
%% equations worked on the audio file and get s, the new starting point of the audio
xdata = data(:,end) %choose the second column and save into xdata
startSample = s;
endSample = length(xdata);
extractedData = xdata(startSample:endSample);
extractedData(1:2*samp_rate ) = [];
audiowrite(Audio_files(p).name '.m4a', extractedData,samp_rate );
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および 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!