Save Consecutive Sounds From an Audio Recording into Individual Variables or Array
6 views (last 30 days)
Show older comments
Good day
I have to analyze vowels and consonants from about 100 different .wav recordings of different people speaking, and compare each vowel and consonant from the first .wav file to the second etc.
I have a plan to isolate each sound (where the amplitude of the file is below 0.1, there is no speaking, only noise) whilst filtering out the silences, and place each sound ("a" then "e" respectively etc.) into its own variable labelled a; e; i etc. in order to compare the vowels and consonants individually to the other recordings.
I have begun writing if loops but this seems to not work at all, since I have 720000 data points for each file.
Please can you help me work out how to do this without taking five hours for each file, for a total of 5*100 hours? I am hoping there is a known function or algorithm which sorts audio sounds consecutively into an array or individual varibles.
Thank you so much
0 Comments
Answers (1)
Pratyush Swain
on 10 Sep 2023
Hey Aidan,
As per my understanding, you need an method to sort audio sounds over multiple audio multiple files.Please find an example implementation of sorting of audio sounds over a single file
[audio, sampleRate] = audioread('audio_file.wav');%Read the audio file using the audioread function
amplitudes = abs(audio);%Extract the amplitudes from the audio samples
[~, sortedIndices] = sort(amplitudes, 'descend');%Sort the audio reads based on the amplitudes
sortedAudio = audio(sortedIndices);%contains the audio reads sorted based on the amplitudes
The similar procedure can be followed by reading audios from multiple files and stacking them row wise to form an audio data matrix,and the sorting them col wise to have to analyze each element amplitude.
Hope this helps.
0 Comments
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!