0
0

Hello All.

I’m new to FMOD but not programming. I was wondering if anyone had any examples of graphing the wave signature of an audio file? Much like some of the popular multitrack recording software does (eg Sonar, Cubase, N-track audio, Steinberg etc) when you load a sound file it’ll show you the waveform of the sound file.

Thanks for a great library to use. If someone has a code example or can point me in the direction of where it is in the Faq I’d greatly appreciate it.

  • You must to post comments
0
0

VB example for making wave form, anyone?

  • You must to post comments
0
0

Not VB, but a nice Delphi component, created by Gonzalo Herrero. Have a look at http://dsp.mirrors.ebizlab.hit.bme.hu/newl/midxd70f.htm and search for WavViewer.

Regards / Jonas

  • You must to post comments
0
0

I had a VB Oscilliscope example but it was deleted from my webspace, but if you would like I could send it to you or upload it again. Or I can just show you haw it can be done, but if it’s confusing than I can send you a zip:

Basically you make a simple DSP callback like this:
[code:16sgrhbe]
Public Function SCOPECALLBACK(ByVal origbuff As Long, ByVal newbuff As Long, ByVal Length As Long, ByVal param As Long) As Long

SCOPECALLBACK = newbuff

End Function
[/code:16sgrhbe]
And in this case we arent going to be changing the audio buffer but instead just reading it to plot it out in a picturebox. The mixer that FMOD is using depicts what data type you need to use. In the callback I have written It will only work for non-fpu mixers.
[code:16sgrhbe]
Public Function SCOPECALLBACK(ByVal origbuff As Long, ByVal newbuff As Long, ByVal Length As Long, ByVal param As Long) As Long

On Error Resume Next
If UBound(BuffData) <> Length Then ReDim BuffData(Length) As Integer
Call CopyMemory(BuffData(0), ByVal newbuff, Length * 2)
FillRect frmMain.picVisuals.hdc, VisCLSRECT, VisCLSBrush
MoveToEx frmMain.picVisuals.hdc, 0, frmMain.picVisuals.ScaleHeight / 2, Point
For x = 0 To Length / 2 Step 8
LineTo frmMain.picVisuals.hdc, (x * 2) * (frmMain.picVisuals.ScaleWidth / Length), (BuffData(x * 2) + BuffData((x * 2) + 1) / 2) / (frmMain.picVisuals.ScaleHeight * 16) + frmMain.picVisuals.ScaleHeight / 2
Next x
SCOPECALLBACK = newbuff

End Function
[/code:16sgrhbe]
VisCLSRECT and VisCLSBrush are variables that I have set up before-hand using the RECT struct and these functions:
[code:16sgrhbe]
Public Declare Function FillRect Lib “user32” (ByVal hdc As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Public Declare Function CreateHatchBrush Lib “gdi32” (ByVal nIndex As Long, ByVal crColor As Long) As Long
Public Declare Function DeleteObject Lib “gdi32” (ByVal hObject As Long) As Long
Private Declare Function LineTo Lib “gdi32” (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function MoveToEx Lib “gdi32” (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
[/code:16sgrhbe]
If you have any questions drop me an email or a pm.

  • You must to post comments
0
0

Paranoid_Android>i don’t think he is talking about oscilloscope but graphing the waveform of audio chunk, this is not the same things ๐Ÿ˜†
You can find an example [url=http://starnetasso.free.fr/Upload/draw_waveform-VB.zip:1wrv5m5c]here[/url:1wrv5m5c] showing this in VB, it can easily be adapted for Fmod streams.

  • You must to post comments
0
0

Thanks for the suggestions people. I am looking for a C++ type example (Microsoft, Borland or even Linux ;).

I know one thing… I am really diggin’ this API/library. I initially was trying something in Java but decided on C++. I was running a couple of prototypes in way less than 1/2 the time. Not a slam against Java. I actually like it and use on my day job. More of an affirmation and appreciation of a well thought out API.

BTW [b:13vcs2ra]KarlKoX[/b:13vcs2ra] you are exactly right in what I am trying to accomplish.

  • You must to post comments
0
0

[quote="KarLKoX":2bjr4qax]i don’t think he is talking about oscilloscope but graphing the waveform of audio chunk, this is not the same things ๐Ÿ˜†
You can find an example [url=http://starnetasso.free.fr/Upload/draw_waveform-VB.zip:2bjr4qax]here[/url:2bjr4qax] showing this in VB, it can easily be adapted for Fmod streams.[/quote:2bjr4qax]

hehe, well, I gave it a shot. Now that I’ve made a fool of myself lol, is it not possible to get a waveform using a DSP callback?

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.