 |
|
 |
Excellent class. Solved my problem. Thank you.
|
|
|
|
 |
|
 |
The class works fine on the local host but does not work at all once it's up on the actual server. What can I do to fix this?
|
|
|
|
 |
|
 |
Thank you I was looking for a way to Notify my users for events due that during entry time, sometimes they do not look at the screen and keep typing.
|
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Thanks for your simple powerful source, is this possible to record simultaneously visualizing? I mean is this any possibility to get a specific samples in a period?
|
|
|
|
 |
|
 |
I downloaded the code and added to my project. Sound works on development machine but not when deployed to web server. I am trying to play the system's exclamation sound.("SystemExclamation")
|
|
|
|
 |
|
 |
I was looking for a freeware app to download, heck with this I was able to right my own to do just what I need. good job.
JHarris
|
|
|
|
 |
|
 |
I tried out a code to play files stored in the resource folder. It is working alright, I wrote these codes to play these files in a Sub method for it to be executed when called. However its more than one method be called within the event of when a button is clicked.
What is happening is that, when the event takes place, that is when the button is clicked, only one method is executed.
--------------------------------------------------------------------
These are examples of the codes:
I've got two different Subs I'll be calling in an event, both are to play sound files. Word() and Say()
Public Sub Word()
.
.
.
If My.Resources.mention.CanRead Then
Dim bStr(My.Resources.mention.Length) As Byte
My.Resources.mention.Read(bStr, 0, My.Resources.mention.Length)
My.Computer.Audio.Play(bStr, AudioPlayMode.Background)
End If
End Sub
Public Sub Say()
.
.
.
If My.Resources.pronounce.CanRead Then
Dim bStr(My.Resources.pronounce.Length) As Byte
My.Resources.pronounce.Read(bStr, 0, My.Resources.pronounce.Length)
My.Computer.Audio.Play(bStr, AudioPlayMode.Background)
End If
End Sub
Below is the event which is when the button 'btnStart' is clicked.
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles btnStart.Click
Say()
Word()
End Sub
When I execute this and click the 'btnStart' button the method that is executed is the second i.e. Word() only.
I can't understand why, what I want it to do is execute Say() then execute Word().
Is there a way to do this or is it that two methods can't be called within an event, can I get any help for this?????
I am really desperate here .
|
|
|
|
 |
|
 |
hello,
I'm trying to find out how to play wave files stored in a connected access database.
How can I do this please?
I tried the code I found from this link:
http://www.aboutmydot.net/index.php/play-wav-file-in-vbnet
-----------------------------------------------------------------------
Dim Sound As New System.Media.SoundPlayer()
Sound.SoundLocation = "your path to the .wav file" 'ex.: c:\mysound.wav
Sound.Load()
Sound.Play()
-----------------------------------------------------------------------
It was ok, but I don't want the path to the .wav file to necessarily start from c:\ since I'm hoping to have this project used on a different machine, meaning if I link it to specific path it would not play on a different machine.
So instead of something like:
"C:\Documents and Settings\User\My Documents\Project\Sounds\mysound.wav"
as the link to the file, in the database field(eg.sWord)I made it short to be like:
\Sounds\mysound.wav
since the access file would also be in the folder Project, so that it could easily locate the wav file.
Therefore within the code instead of
Sound.SoundLocation = "your path to the .wav file" 'ex.: c:\mysound.wav
I made it
Sound.SoundLocation = SWordTextbox.Text where SWord.Textbox is the field in the database having the link to the wav file and therefore it's text property assigns the link to the attribute .SoundLocation.
I hope I've explained better, I'm kind of new to VB.net. Any help will be greatly appreciated.
Thanks.
|
|
|
|
 |
|
 |
Great article and explanation.
Do you know a way to select the device to use for audio playing (other than changing the default device in control panel)?
Thanks
Claudio
|
|
|
|
 |
|
 |
It use the standard output, I don't know it is possible the choose a specific device.
Regards /// Angelo
|
|
|
|
 |
|
 |
I have a question.
How to stop the sound?
Thanks...
|
|
|
|
 |
|
 |
how do i get the duration of .wav file in vb.net???
|
|
|
|
 |
|
 |
You'll have to extend the code yourself.
This can be done by using the same API winmm.dll that is being used.
Simply add some more declarations, and work out some additional methods.
Here are just a few, I'll suggest you research the API at msdn.microsoft.com
Private Declare Function waveOutOpen Lib "winmm.dll" Alias "waveOutOpen" (ByVal lphWaveOut As Long, ByVal uDeviceID As Long, ByVal lpFormat As WAVEFORMATEX, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Long
Private Declare Function waveOutWrite Lib "winmm.dll" Alias "waveOutWrite" (ByVal hWaveOut As Long, ByVal lpWaveOutHdr As WAVEHDR, ByVal uSize As Long) As Long
Private Declare Function waveOutPause Lib "winmm.dll" Alias "waveOutPause" (ByVal hWaveOut As Long) As Long
Private Declare Function waveOutRestart Lib "winmm.dll" Alias "waveOutRestart" (ByVal hWaveOut As Long) As Long
Private Declare Function waveOutSetPitch Lib "winmm.dll" Alias "waveOutSetPitch" (ByVal hWaveOut As Long, ByVal dwPitch As Long) As Long
Private Declare Function waveOutGetPosition Lib "winmm.dll" Alias "waveOutGetPosition" (ByVal hWaveOut As Long, ByVal lpInfo As MMTIME, ByVal uSize As Long) As Long
Private Declare Function waveOutGetErrorText Lib "winmm.dll" Alias "waveInGetErrorTextA" (ByVal err As Long, ByVal lpText As String, ByVal uSize As Long) As Long
Private Declare Function waveOutClose Lib "winmm.dll" Alias "waveOutClose" (ByVal hWaveOut As Long) As Long
Private Declare Function waveOutGetID Lib "winmm.dll" Alias "waveOutGetID" (ByVal hWaveOut As Long, ByVal lpuDeviceID As Long) As Long
Private Declare Function waveOutGetNumDevs Lib "winmm.dll" Alias "waveOutGetNumDevs" () As Long
Private Declare Function waveOutPrepareHeader Lib "winmm.dll" Alias "waveOutPrepareHeader" (ByVal hWaveOut As Long, ByVal lpWaveOutHdr As WAVEHDR, ByVal uSize As Long) As Long
Private Declare Function waveOutUnprepareHeader Lib "winmm.dll" Alias "waveOutUnprepareHeader" (ByVal hWaveOut As Long, ByVal lpWaveOutHdr As WAVEHDR, ByVal uSize As Long) As Long
Public Const WAVE_MAPPER = -1&
Public Const WAVE_FORMAT_PCM = 1
Public Structure WAVEHDR
Dim lpData As Int32
Dim dwBufferLength As Int32
Dim dwBytesRecorded As Int32
Dim dwUser As Int32
Dim dwFlags As Int32
Dim dwLoops As Int32
Dim reserved As Int32
Dim lpNext As Int32
End Structure
Public Structure WAVEFORMATEX
Dim wFormatTag As Int16
Dim nChannels As Int16
Dim nSamplesPerSec As Int32
Dim nAvgBytesPerSec As Int32
Dim nBlockAlign As Int16
Dim wBitsPerSample As Int16
Dim cbSize As Int16
End Structure
Structure MMTIME
Dim wType As Long
Dim u As Long
End Structure
That should be enough to get ya started. It's a pretty easy API to get, have fun. Hope this helps.
|
|
|
|
 |
|
 |
I would like to is there any way I can run the above mentioned files using a contol in VB.NET. This is for the purpose of displaying advertisement that comes in these mentioned format.
|
|
|
|
 |
|
 |
good demo , thanks
|
|
|
|
 |
|
 |
can I loop the sound with this code? If so how?
Thanks for the code
|
|
|
|
 |
|
 |
This class file is extremely efficient...I found this useful for a product to play a sound on a notification....Exactly what I was looking for....something to play a sound...any sound....something that has a small foot-print and add next to nothing on the memory footprint.
Micronic
|
|
|
|
 |
|
|
 |
|
 |
:-OI would like to know if there is a possibility to paly mp3. or wma file?
Does anybody can help me?
|
|
|
|
 |
|
 |
Yes, there are a few ways you can play mp3/wma files.
You can use a 3rd party library. Example: the Bass Sound System or FMod.
You can use the Windows Media Player Component.
Or the method I recommend, is to use the MCI Command Interface, which is supported on Win9x all the way up to the latest Windows XP versions and such. You do not have to really worry about compatibility or worry about Distributing any files with your applications going this route.
I have pre-made librarys that will do what you want and more, and is ready to go. Or you can check out the tutorial at my website that will show you how to use the mciSendString Command Interface yourself to make a full-featured media application.
It is completely up to you. Hope this helps
Jason
|
|
|
|
 |
|
 |
Hi,
I m using .net 2003. I don’t fine anything like .position with control AxWindowsMediaPlayer. I want to stop playing file at specific time too. I mean one can enter starting and terminating time through edit box and control must repetitively play file in between that time only.
If any one has a solution without .position then kindly post the same.
Regards,
-Parth
-- modified at 13:37 Thursday 22nd June, 2006
|
|
|
|
 |
|
 |
in code
AxMediaPlayer1.FileName="c:\temp\test.avi"
AxMediaPlayer1.Play
working properly, but when I try to play .wmv
files
AxMediaPlayer1.FileName="c:\temp\test.wmv"
AxMediaPlayer1.Play
i got error in line axmediaplayer1.play
files test.avi and test.wmv exist adn they work properly in any player
Why?
I think that this error is same one as if I dont have file or file is wrong.
"An unhandled exeption of type
System.runtime.interoptservices.COMExeption
occured in axiteropt.mediaplayer.dll
Additional information: Unspecified error"
File test.wmv exist and work in Windows media player when i start his directly
Thanks in advance
|
|
|
|
 |
|
 |
Try this:
AxMediaPlayer1.position= 'number of frame'
AxMediaplayer1.play
|
|
|
|
 |