473,569 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

If e.newState = Me.AxWindowsMed iaPlayer1.playS tate.wmppsStopp ed then

BeginInvoke(New MethodInvoker(A ddressOf playItAgain))

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

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

Thanks!

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

My.Computer.Aud io.Play(filenam e1, AudioPlayMode.W aitToComplete)
My.Computer.Aud io.Play(filenam e2, AudioPlayMode.W aitToComplete)

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

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

If e.newState = Me.AxWindowsMed iaPlayer1.playS tate.wmppsStopp ed then

BeginInvoke(New MethodInvoker(A ddressOf playItAgain))

end if
Private Sub playItAgain()
AxWindowsMediaP layer1.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
3761
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 manipulating all the nodes,elements and attributes than I am writing those values to a text file using stream writer. Now coming to my problem When...
0
1243
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 which can be downloaded via the standard HTML Anchor element. This has been working with no problems for months but now we sometimes see files...
4
2050
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 prints and mails our bills. The application basically creates a table then exports a comma delimited file of that table. The problem is that we keep...
45
3410
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 doesn't check whether there is more characters entered by the user the what can be stored but I don't know what the safe equivalent of gets() is. ...
2
7877
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 (AxSHDocVw.AxWebBrowse) control. The TreeView is populated with nodes that when clicked play an audio clip that is stored on the CD and navigate the...
13
4857
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, suggestions or improvements? if( wmv file) document.write("<OBJECT id=Player classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 height="354"...
2
2176
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 BatmoAudiopop.js which opens a pop-up browser window with an audio player when a link is clicked. Basically, it sets the right mime-type depending on the...
2
5051
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 is also to be played in the background so that the user gets a feel for the synchronization. The user should be able to fully control the start,...
3
3438
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 GetAudio. And an example seems to do a SwapAudio which makes no sense. Basically I want to spool or simulate spooling of audio. So is this reasonable...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7968
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.