Read Text File and extract audio value

6 Ansichten (letzte 30 Tage)
Benson Yong Zhi Lau
Benson Yong Zhi Lau am 30 Sep. 2019
Beantwortet: Gaurav Garg am 3 Okt. 2019
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 Kommentar
Adam
Adam am 30 Sep. 2019
Have you tried the obvious things like
doc importdata
?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Gaurav Garg
Gaurav Garg am 3 Okt. 2019
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.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by