MATLAB Answers

Real Time Audio with AppDesigner?

17 ビュー (過去 30 日間)
Pascal Westermeier
Pascal Westermeier 2020 年 6 月 24 日
編集済み: Kavya Vuriti 2020 年 6 月 30 日
Hi Guys,
I want to edit a audio file, which I load with a push button, with e. g. a filter while the song is playing.
Since I am still quite inexperienced with the app designer, I wanted to ask if anyone knows if it is
even possible to edit audio files in real time with the app designer (without Simulink).
And if possible, how I can implement it with the app designer.

回答 (1 件)

Kavya Vuriti
Kavya Vuriti 2020 年 6 月 30 日
編集済み: Kavya Vuriti 2020 年 6 月 30 日
You can edit data captured in an audio file or any real time audio data by clicking a button in app designer. Launch app designer by typing the following command in command window.
Drag and drop a push button on the canvas. A component browser is displayed on the right side with properties and callbacks of the push button. Add the callback 'ButtonPushedFcn' .Here is the documentation for adding callbacks for components in app designer.
In the code view, you can try writing code for capturing real time audio using system objects like audioDeviceReader or loading an audio file using audioread function . In the callback function, you can also modify the data like increasing/decreasing amplitude or changing sampling rate. If necessary, you can play the modified data using system objects like audioDeviceWriter or write it to another audio file using audiowrite function.
For using above mentioned system objects, "Audio Toolbox" is required.
Refer to the following links for more information on real time audio in MATLAB and loading data from audio files into MATLAB:

Community Treasure Hunt

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

Start Hunting!

Translated by