473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Second audio file gets truncated

I am using Windows Media Player to play my half second audio files one after
the other using the code below...

My problem comes when I play a second audio file immediately after the first
one stops sometimes on slower computers the audio on the second file gets
truncated on the beginning of playing the second file. What can I do to
minimize this truncation of audio? Right now I am having to add 1 second of
blank audio to the beginning of the second audio file but I would rather not
have the delay.

Here the code I am using ...

+++++++++++++++++++++++

' Play first voice file

AxWindowsMediaPlayer1.URL = voice1.mp3
' Play echo voice file once first one completes

If e.newState = Me.AxWindowsMediaPlayer1.playState.wmppsStopped then

BeginInvoke(New MethodInvoker(AddressOf playItAgain))

end if
Private Sub playItAgain()
AxWindowsMediaPlayer1.URL = voiceEcho.mp3
End Sub

+++++++++++++++++++++++

Thanks!

Bob
Jul 21 '08 #1
1 1718
Are you able to use

My.Computer.Audio.Play(filename1, AudioPlayMode.WaitToComplete)
My.Computer.Audio.Play(filename2, AudioPlayMode.WaitToComplete)

instead?

--
David Streeter
Synchrotech Software
Sydney Australia
"BobAchgill" wrote:
I am using Windows Media Player to play my half second audio files one after
the other using the code below...

My problem comes when I play a second audio file immediately after the first
one stops sometimes on slower computers the audio on the second file gets
truncated on the beginning of playing the second file. What can I do to
minimize this truncation of audio? Right now I am having to add 1 second of
blank audio to the beginning of the second audio file but I would rather not
have the delay.

Here the code I am using ...

+++++++++++++++++++++++

' Play first voice file

AxWindowsMediaPlayer1.URL = voice1.mp3
' Play echo voice file once first one completes

If e.newState = Me.AxWindowsMediaPlayer1.playState.wmppsStopped then

BeginInvoke(New MethodInvoker(AddressOf playItAgain))

end if
Private Sub playItAgain()
AxWindowsMediaPlayer1.URL = voiceEcho.mp3
End Sub

+++++++++++++++++++++++

Thanks!

Bob
Jul 22 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sp | last post by:
Hello everybody, I have an xml doc and I am trying to write the values from xml file to a tab delimited text file. Currently, what I am doing is I am reading xml file through XpathNavigaotr and...
0
by: David Bray | last post by:
Has anyone encountered (and solved!) this problem? I have an Access database on a commercial ISP. There is an ASP page/script which creates a recordset from the database and then writes a file...
4
by: Jay | last post by:
This is a strange one that I can't seem to find a fix for. We have a Billing DB application (Access 2000 format) where we upload billing info in a comma delimited text file to our printer who...
45
by: Anthony Irwin | last post by:
Hi, I am fairly new to C and all the C books I got talk about gets() but when I compile it says I should not use gets() because it is dangerous. I understand that it is dangerous because it...
2
by: hzgt9b | last post by:
Using VS2003, VB.NET, BACKGROUND I have a window forms based application that will be distributed and executed directly from CD media. The app contains a TreeView control and a WebBroswer...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
2
by: peteinglastonbury | last post by:
I'd be most grateful if someone would help me. I hope I'm in the right forum (apologies if not) - I'm not sure whether my problem is CGI or Javascript related. I found a script called...
2
by: gskrishnan | last post by:
I would like someone to help me with VB code for the following problem. I want to play a composed audio file of a certain beat cycle. A metronome file corresponding to the audio file beat cycle...
3
by: AWW | last post by:
Using XP and VB 2005, it seemed like a good idea to save audio in the clipboard and then play it with backgroundworker. Cannot find a good Clipboard audio example anywhere - just SetAudio and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.