rendering a waveform on an iphone

≯℡__Kan透↙ 提交于 2019-12-17 22:19:48

问题


I was wondering if anyone has any suggestions on how to go about rendering a waveform of an audio file. I wold like to enable the user to set an in and out point of an audio track and I need to have a waveform so you can see where to put the points.

Are there any libraries available for this or does it need to be a completely custom solution?

Is it even called a waveform ? Maybe there's a better word for it so I can do some more searching.

TIA !


回答1:


I'm reposting my answer from this question, since it applies here as well:

When displaying an audio waveform, you will want to do some sort of data reduction on the original data, because there is usually more data available in an audio file than pixels on the screen. Most audio editors build a separate file (called a peak file or overview file) which stores a subset of the audio data (usually the peaks and valleys of a waveform) for use at different zoom levels. Then as you zoom in past a certain point you start referencing the raw audio data itself.

Here are some good articles on this:

Waveform Display

Build an Audio Waveform Display

As far as source code goes, I would recommend looking through the Audacity source code. Audacity's waveform display is pretty good and mostly likely does a similar sort of data reduction when rendering the waveforms.




回答2:


CorePlot is the library you are looking for. It is hosted on Google code.

See this related SO question.




回答3:


I realise this is an old post, however i searched for this recently, and decided to roll my own solution based on a few snippets i located on SO and a few other sites.

See my answer to This question



来源:https://stackoverflow.com/questions/896194/rendering-a-waveform-on-an-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!