Read Text File and extract audio value

조회 수: 11 (최근 30일)
Benson Yong Zhi Lau
Benson Yong Zhi Lau 2019년 9월 30일
답변: Gaurav Garg 2019년 10월 3일
Hi everyone,
I have a lot of txt files which was digitalised from .wav files. Is there any way that I can do to read and extract the audio values of 8khz. Thanks. A sample of the txt files is attached below. Thanks.
  댓글 수: 1
Adam
Adam 2019년 9월 30일
Have you tried the obvious things like
doc importdata
?

댓글을 달려면 로그인하십시오.

답변 (1개)

Gaurav Garg
Gaurav Garg 2019년 10월 3일
Hi,
I understand that you wish to extract audio from the given text file.
You can use importdata function to read the file into an array and sound function to extract audio from it.
A=importdata (Sample.txt);
sound (A,8000);
The file attached by you contains [‘ and ‘]’ in the beginning and end. importdata would store the file as a single cell in this case. So, ensure that you have removed ‘[‘, ‘]’ and then save the file again.

카테고리

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