I don't want to replace the existing file instead create a new audio file with the trimmed data, how do I achieve that?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rezaul Reza
am 29 Dez. 2021
Bearbeitet: Rezaul Reza
am 30 Dez. 2021
- I dont want to replace the exisiting file instead create a new file with the trimmed data, how do i achieve that?
- If I want to read the value from the text field instead of command line, what do i need to change or add ?
Akzeptierte Antwort
Cris LaPierre
am 29 Dez. 2021
Questions 1 and 4 are the same. As I stated previously, you need to use a different filename in your audiowrite code to avoid overwriting the original file.
audiowrite(app.IMPORTEditField_2.Value,y((num_samp*(a-1))+1:num_samp*b,:),fs);
% ^^^^^^^^^^^^^^^^^^^^^^^^^^^ <- define a new/different name here
Question 2: Also answered previously. Get rid of the calls to input in your TRIM callback functions. Have it query the values of your START and END edit fields
a = app.STARTEditField.Value;
b = app.ENDEditField.Value;
Question 3: How do you mix two audio files in MATLAB?
2 Kommentare
Cris LaPierre
am 29 Dez. 2021
Bearbeitet: Cris LaPierre
am 29 Dez. 2021
It looks like the issue is you used text Edit Fields for your Start and End inputs. Replace these with numeric Edit Fields. Name them the exact same thing so you don't have to change any other code.
A = 1:5;
% works
A(2)
% Doesn't work
A('2')
With them being numeric, you can now set the Limits property so that the user cannot specify a value greater than the length of your audio signal.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Audio and Video Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



