Convert the stereo sound to the mono sound by loading only one channel data into the result vector

조회 수: 114 (최근 30일)
Hi, I am having trouble with this code. I want to do what the title says, but I don't know how to load only a single channel into my vector. Can someone help me, please?
the code:
% clear all the previous contents in workspace.
clc;
clear all;
% Read the audio file
[y, Fs] = audioread(Jolly Laugh.wav; % read audio file to array
% Convert the stereo sound to the mono sound by loading only one channel
% data into the result vector
y = y(__________);
% play the audio
sound(y,Fs);

채택된 답변

Walter Roberson
Walter Roberson 2019년 10월 6일
single_channel_from_y = y(:,1);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by