AudioPlayer object: Algorithm for an audio player progress bar.

8 ビュー (過去 30 日間)
Farshad Bolouri
Farshad Bolouri 2020 年 4 月 10 日
編集済み: Walter Roberson 2020 年 4 月 10 日
I am currently trying to implement an audio playing feature to an app that my group is working on.
As Can be seen in the image the app displays a spectrogram of 4 different recodings. I am trying to add a feature in which the user could hear each of these recordings.
I already can play the recordings. My main problem is an algorithm for a progress bar (I am not sure if this is what its called). The image below shows an example of what I am talking about.
Can anyone please guide me through how to develop this bar and show me a simple code? Or refer me to an example?
Thank You
  2 件のコメント
David Hill
David Hill 2020 年 4 月 10 日
You might look at the coding for the following file exchange:
Walter Roberson
Walter Roberson 2020 年 4 月 10 日
That example looks to me as if the circled bar is an xor() of a constant color against the color of the spectra line. Unfortunately though, xor graphics drawing was removed about 5 years ago.
It would probably be easiest to draw a vertical line in a solid color, and then at each iteration, changes the lines XData properties, and then drawnow()

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2020 年 4 月 10 日
編集済み: Walter Roberson 2020 年 4 月 10 日
You can set a TimerFcn property for audioplayer objects, and control how often it fires with TimerPeriod.
When the timer fires, the second parameter in its callback with be a struct . That struct will have a field named Data which has a subfield named time which is what time the event occurred at. You can read that time out from the event structure and use it to set the XData of the line.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by