Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Jan 29, 2020 2:50 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Using qtimeMBS to create wave picture
PostPosted: Wed Oct 20, 2010 12:16 pm 
Offline

Joined: Fri Jan 08, 2010 9:59 am
Posts: 315
Hi there all MBS users (and Christian)

I'm looking at using the qtimeMBS functions to shoot thru a movie at poistions of say the duration/100
at those points I want to get the

I have this
TimeMBS as integer
time units = seconds * time scale
Position = PositionTime / TimeScale
and
GetSoundLevelMeterValue as integer (method from class QTGrabberMBS)

this is what I want (if you could fill in the blanks) (player is the movieplayer on the window, canvas1 is well, a canvas)


dim i,x,y,y0,y1,x1,x2,j, y2,x3 as integer=0
dim svolumn(100) as integer
x=canvas1.width
y=canvas1.height


dim m as movie
f=GetOpenFolderItem("")
if f <> Nil then
m=f.OpenAsmovie
Player.Movie=m
end if
x1=player.duration
x2=x1/100

for i=0 to 100
//player.position=i*x2 - these two lines are what I need the syntax for
//svolumn(i)=player.GetSoundLevelMeterValue
//if svolumn(i)>j then j=svolumn(i) ' gets the loudest volumn)
next

x2=x/100 ' this is the canvas width divided into 100
y=canvas.height/2+canvas.top 'sets the midline in the canvas
y2=y
canvas1.graphics.ForeColor=&c0000ff
x3=0+canvas1.left
for i=1 to 100
y1=y+(y/j) ' this sets the volumn for the midpoint+the volumn amount
canvas1.graphics.DrawLine(x3,y2,canvas1.left+(x2*i),y1)
y2=y1
x3=x2
next


so, what would I use for the 'rem'ed statements for this to work?

If we find this out, this means that we have a class that we can call to draw a waveform on any canvas, any size in our windows with the help of MBS quicktime features.

and yes, I have googled and searched the web and the forum extensively looking for this.
I know theres a class for this on the web - it's buggy (wont play), takes ages to draw it, and flickers like a beast in windows (so it's not really cross platform)

If I get these answers, I will make a complete class - and I will post it here in step by step instructions so you can't go wrong. Obviously there are a lot of other features to include but this is the bare bones and hopefully there'll be more to come!
cheers,
Sean


Top
 Profile  
Reply with quote  
 Post subject: Re: Using qtimeMBS to create wave picture
PostPosted: Wed Oct 20, 2010 1:37 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
If you want to draw a waveform, get the raw sound data using movie.SoundRawDataMBS from our plugin.
There you can search the highs and lows for each line you draw in your waveform.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: Using qtimeMBS to create wave picture
PostPosted: Wed Oct 20, 2010 1:49 pm 
Offline

Joined: Fri Jan 08, 2010 9:59 am
Posts: 315
How would I go through it to get the different positions?

is the raw data in a memory block?

can you be a little more specific?

I live in Poland - could I give you a call?

Cheers,
Sean


Top
 Profile  
Reply with quote  
 Post subject: Re: Using qtimeMBS to create wave picture
PostPosted: Wed Oct 20, 2010 3:27 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
There is at least one sample app on our website, I think.

You get a memoryblock with the sound format you requested. So you walk over the bytes and count the min/max values for the channels you requested.

Our office is open tomorrow and the phone number is on the website...

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group