Re: Soundplaying problems!
It should work if you use the PlaySound API.
I think you will probably have to play the sounds Syncronously unless you can find a way to detect when the sound has finished playing (possibly use a timer if the time of the sound is constant)
Re: Soundplaying problems!
If the sounds are WAVe files, then you can use DirectSound to play the sounds.
Also, you can append all files into one, then you can play them in any player.
Re: Soundplaying problems!
It isn't possible to append all files into one since the program uses different soundfiles different times.
How do I use this DirectSound thing? Can it really play several soundfiles without any pause interval at all in between?
Where do I find this PlaySound API?
Re: Soundplaying problems!
The main reason for why the pauses appear between the soundfiles using the WMP component is that it takes a second to open the soundfile and load it. :(
Is there someway to maybe load the soundfile when the program starts so it's ready to play up the soundfiles at any time? :confused:
It would be really good if anyone could help me with this! :)
Re: Soundplaying problems!
Can you specify what kind of sound files ?
Re: Soundplaying problems!
Short MP3 files...just a second or two. It's for a text-to-speech program and I don't want it to pause between every letter.
Plz help :cry:!
Re: Soundplaying problems!
If you don't have a solution for MP3 files...I can convert them to WAV files.
Re: Soundplaying problems!
Quote:
Originally Posted by cyber_alex
Short MP3 files...just a second or two. It's for a text-to-speech program and I don't want it to pause between every letter.
Plz help :cry:!
See if you have said that from the beginning, things would be much more clear.
OK, so the best way is to load the MP3's into memory (though I don't know how to do it with MP3, only with WAV)
You can load all in memory, then just play each one when the time comes.
Take a look at this thread because it is simmilar:
http://www.vbforums.com/showthread.php?t=376046
It loads all the sounds into an array, then plays them...
Re: Soundplaying problems!
okay..tnx, I'll check it out :)
Re: Soundplaying problems!
can't say I got much smarter of that...didn't understand a lot of that guitar-base thing... :ehh:
All I want to know is simply how to play serveral mp3 or wav files after eachother without any pause intervalls in between.
Can anyone help me with this? :(
Re: Soundplaying problems!
here's another example ... sample uses 2 windows media wave sounds, ding and chord, you can suppliment them with your own .. sample works on the letter a and b .. but obviously you can alter all that part ..
Attached the sample project.
Re: Soundplaying problems!
To tell you the truth, even if you make the program play the sounds without pause in between, it will still not sound right.
You are trying to make a text-to-speech program. Human voice is more complex than just playing the same sounds in different order (the letters in the word).
You need to MIX the sounds (the ending of previous letter with beginning of current letter), even then it won't sound right, but it will be closer to what you want.
You need to learn more about sound before you start making your text-to-speech program.
Let me take a look in that program (the link I gave you in previous post), and extract the code where it loads the sounds, and plays them. It will take me a little while (I'm at work now)
Re: Soundplaying problems!
Quote:
Originally Posted by CVMichael
Let me take a look in that program (the link I gave you in previous post), and extract the code where it loads the sounds, and plays them. It will take me a little while (I'm at work now)
Actually the code is so simple, you can't get any easier than this...
Anyways...
The initializations:
VB Code:
Private DX As New DirectX8
Private SEnum As DirectSoundEnum8
Private DIS As DirectSound8
Private ABuff() As DirectSoundSecondaryBuffer8
Loading the sounds:
VB Code:
Private Sub Form_Load()
Dim BuffDesc As DSBUFFERDESC
Dim K As Long
Set SEnum = DX.GetDSEnum
Set DIS = DX.DirectSoundCreate(SEnum.GetGuid(1))
DIS.SetCooperativeLevel Me.hWnd, DSSCL_NORMAL
ReDim ABuff(25)
For K = 0 To 25
BuffDesc.lFlags = DSBCAPS_STATIC
FileName = App.Path & "\Wav\A-" & K & ".wav"
Set ABuff(K) = DIS.CreateSoundBufferFromFile(FileName, BuffDesc)
Next K
Playing the sounds:
VB Code:
ABuff(Sound_Index).Play DSBPLAY_DEFAULT
Re: Soundplaying problems!
tnx, I'll try it when I have time :)
Re: Soundplaying problems!
Downloading SAPI SDK and making your own voice engine may be another option.
It is not hard to make a voice, but it is not one man's job.