2

Well, I'm not sure how this thing should be called.. But I need to read sound file and generate this (in iOS):

enter image description here

It's kinda sound map, or sound diagram...

Thanks!

Dmitry
  • 1,004
  • 2
  • 14
  • 25

2 Answers2

1

I am not sure how will you draw the waves but here is a link to apples sample project that will help you get the data to draw the sinusoidal waves.

http://developer.apple.com/library/ios/#samplecode/SpeakHere/Introduction/Intro.html

I think you can use the bezier curves to draw a sine wave by using the data gathered from the above code sample.

Robin
  • 9,969
  • 5
  • 47
  • 74
  • oh, I remember I already discovered this app long time ago. It's has really sh**ty code written on C. Possibly there is some high level functions exists for this..? Also, the difference is that it's analyze sound file on fly but I need to pre-analyze all the file before it starts to play. Anyway, thanks for your answer! – Dmitry Nov 28 '11 at 13:05
  • It actually analyzes the sound that is recorded. If you dig into its code than you might come across the piece of code that is responsible for converting the analytical data into statistical one. – Robin Nov 29 '11 at 04:40
1

A more common terminology for your sound file image is "waveform", or a plot of the amplitude of the raw waveform with a shortened time axis. This is easiest to do with uncompressed audio files, such as in .WAV format, where you can just read the PCM values and plot them.

hotpaw2
  • 68,014
  • 12
  • 81
  • 143
  • thanks for answer. do you know any ways to fetch this info from WAV file? – Dmitry Nov 28 '11 at 15:51
  • Here's a page on the most common uncompressed WAVE/RIFF file format: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ . You can usually just read the bytes past the header and convert to a C array of C data types. – hotpaw2 Nov 28 '11 at 18:19