20 Jun '13 - 08:56 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: VB.NET Waveform drawing example  (Read 1409 times)
smoodilo
Guest
« on: 17 Mar '12 - 15:49 »
Reply with quoteQuote

I'm implementing the vb.net waveform drawing, and I came across a question:

Is there a way to make the loudest part of the mp3 to be 100% of the waveform?
I use MP3gain tot level all songs, but if I then draw the waveform, the peaklevels of the waveform go to only about half the height of the picturebox. I know this is accurate, but in this case I'd rather go for seeing better where the beats are.

Is this possible?

I have a workaround (I put the picturebox inside a panel, and make that panel lower than the actual picturebox height). But obviously this is bad practice.

Bernd?




Logged
radio42
Posts: 4030


« Reply #1 on: 18 Mar '12 - 18:52 »
Reply with quoteQuote

The WaveForm has a "GainFactor" property which can be used to 'amplify' the graph.
In your case you might set this property to +2.0.
Logged
smoodilo
Guest
« Reply #2 on: 19 Mar '12 - 07:46 »
Reply with quoteQuote

Thank you,

That's what I was searching for.

Another question:
Do you know where BassDShow_Channelsetwindow went in the namespace? I can't find it anymore.


Logged
radio42
Posts: 4030


« Reply #3 on: 19 Mar '12 - 16:49 »
Reply with quoteQuote

It was once removed as far as I remember.
But it might have been re-added lately...however, it is a bit of a mess to implement the DSHOW API, as the develpoer changes that very often without much notice what really has changed.
So it might be, that I need to provide an update for the latest DSHOW version!
Logged
smoodilo
Guest
« Reply #4 on: 22 Mar '12 - 13:57 »
Reply with quoteQuote

Hello Bernd,

Another question/ feature request about the markers:

If I set the markername to be on top, it's really on top of the line. So if I set the line to 1 (100%) the label is out of scope. I need to make the line smaller up to 70%  to see the name, but this means the line is very short on the bottom.

So my feature-request is: Instead of putting the label on top of the line, could you please change this to the 'top-right of the line'? (So the upperleft corner of the label is at the top of the line).

Is this possible?








Logged
radio42
Posts: 4030


« Reply #5 on: 22 Mar '12 - 15:25 »
Reply with quoteQuote

I'll take a look!
Logged
smodielo
Guest
« Reply #6 on: 25 Mar '12 - 09:18 »
Reply with quoteQuote

Thanks,

While experimenting I came to another bottleneck: It does not work for videofiles. So I can't combine it with BassDshow.

I have 2 solutions in mind:

1. Currently you read the needed data by scanning the file. Why don't you use the already created bass stream for that (ChannelGetData)? I assume this will work for any file, so video as well.

Another advantage of this would be that it would also work with downloading/streaming channels.


2. A workaround would be to have 2 files on the computer. The normal video file and a separate ultra-low-bitrate audio-only track from the video's audio. But of course this is not really a nice solution.

Any thoughts on this?


Logged
radio42
Posts: 4030


« Reply #7 on: 25 Mar '12 - 10:31 »
Reply with quoteQuote

You can do this already (use an already prepared stream handle to do the WaveForm rendering)!
Simply use the "WaveForm.RenderStart(int decodingStream, bool background)" method overlaod - see the docs for details and examples.
Logged
smodielo
Guest
« Reply #8 on: 26 Mar '12 - 07:57 »
Reply with quoteQuote

I tried this, but it doesn't work. What should the filename be if I use a streamhandle? Should I even pass a filename if I use an already created stream?

------------
Private Sub SetupWaveForm(ByVal filename As String, ByVal BassStream As Integer)
        wf = New WaveForm(filename, New WAVEFORMPROC(AddressOf WFCallback), Me)
        wf.RenderStart(BassStream, True, False)
        wf.SyncPlayback(BassStream)
End Sub
------------
Logged
radio42
Posts: 4030


« Reply #9 on: 26 Mar '12 - 11:39 »
Reply with quoteQuote

The filename isn't important in such case, e.g. you might use the constructor which doesn't take any filename resp. use "String.Empty".
Note, that your prepared "BassStream" MUST be a decoding one, i.e. the BASS_STREAM_DECODE flag must have been specified with your stream creation call.
Can you please show how you created your "BassStream"...
Logged
smodielo
Guest
« Reply #10 on: 26 Mar '12 - 12:25 »
Reply with quoteQuote

BassStream = BASS_StreamCreateFile(SongTmpPathPlayer1, 0, 0, OUTPUT)

(Where output are the selected speakers).

If I read the docs it will not work for me since e.g. the speakerflags do not work on a decoding channel.

So I end up creating 2 channels again. One normal for playing, and one decoding for retrieving the wavedata.

Logged
radio42
Posts: 4030


« Reply #11 on: 26 Mar '12 - 13:20 »
Reply with quoteQuote

Yes.
Note, that the WaveForm class needs to call BASS_ChannelGetData internally to get the channels sample data to render it.
When using that on a 'playback' channel it would 'stead' that data from it.
Logged
smodielo
Guest
« Reply #12 on: 26 Mar '12 - 16:03 »
Reply with quoteQuote

Yes.
Note, that the WaveForm class needs to call BASS_ChannelGetData internally to get the channels sample data to render it.
When using that on a 'playback' channel it would 'steal' that data from it.

OK, I understand. Thanks.

Logged
jaeminem
Posts: 3


« Reply #13 on: 15 May '12 - 03:04 »
Reply with quoteQuote

Thanks
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines