|
-
Aug 15th, 2007, 06:51 PM
#1
Thread Starter
Member
How can I find information on axmediaplayer?
I am using the media player com component(axmediaplayer) for a personal project I'm working on. the project is called "the slumber machine", it's basically an ambient music player (ie relaxing, chilled out, drones, and music to sleep). I have a bunch of samples that I've created over the years so I have them in a folder and the Slumbermachine randomly plays the samples using a random playback speed. So far it works pretty good, but...
What I want to figure out is how to determine when a track is going to end and fade it out so it will fade out the end of the song and fade back in on the next sample. Here is the code I'm using so far:
Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If AxMediaPlayer1.CurrentPosition = AxMediaPlayer1.SelectionEnd - 10 Then
If Not BackgroundWorker2.IsBusy Then
BackgroundWorker2.RunWorkerAsync()
End If
End If
End Sub
Private Sub BackgroundWorker2_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker2.DoWork
VolumeFadeOut1()
End Sub
Private Sub VolumeFadeOut1()
Do While AxMediaPlayer1.Volume > -6000
AxMediaPlayer1.Volume = AxMediaPlayer1.Volume - 100
System.Threading.Thread.Sleep(300)
Loop
End Sub
This kind of works, but it seems very unreliable and crash prone. Unfortunately the media player volume works where 0 is the highest volume and -6000 seems to be the lowest.
So is there any info I can read to learn more about this com component?
Thanks bunches!
Last edited by SlumberMachine; Aug 15th, 2007 at 10:58 PM.
-
Aug 16th, 2007, 07:53 AM
#2
Re: How can I find information on axmediaplayer?
You might want to look at the DirectX.DirectSound object instead of using the axmediaplayer COM object. It does the same things but it's documented better in MSDN.
-
Aug 16th, 2007, 08:48 AM
#3
Re: How can I find information on axmediaplayer?
If you do continue with the Media Player, check here:
http://msdn2.microsoft.com/en-us/library/bb262038.aspx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|