SAPI 4 and SAPI 5 UserLibrary

Developed or developing a new product in PureBasic? Tell the world about it.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

Esteban1 wrote: By the way, why is it so important to reproduce AND's effect?
Is it for a contest or something?
If so it would be nice to see my name included in the credits (just a joke).

Well, this is the starting point for a lot of tricks...
thanks a lot for posting this great example! i will take a clother look when i when i have sleeped a bit... btw, its not so important to reproduce ANDs effect... i just only want/need to play the voice with a reverb/echo/hall or something like that... i have to play a bit with it... i thought about saving the voice as WAV to memory and then manipulate the WAV (adding echo or any effect)... we will see... now i am going to bed... thanks a lot!

Very cool source!!!
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Esteban1
User
User
Posts: 37
Joined: Sat Jul 16, 2005 4:39 pm
Location: Uruguay

Post by Esteban1 »

I removed some glitches and the overlapping that happens when a piece of text is longer than the others.

Code: Select all

;/ Speaking from memory using SAPI 5 
;/ By Esteban1 
;/ 08-14-2005 

#CLSCTX_INPROC_SERVER  = $1 
#CLSCTX_INPROC_HANDLER = $2 
#CLSCTX_LOCAL_SERVER   = $4 
#CLSCTX_REMOTE_SERVER  = $10 
#CLSCTX_ALL = (#CLSCTX_INPROC_SERVER|#CLSCTX_INPROC_HANDLER|#CLSCTX_LOCAL_SERVER|#CLSCTX_REMOTE_SERVER) 

Structure VARI ; if you have this structure already defined just comment it 
  vt.w 
  wReserved1.w 
  wReserved2.w 
  wReserved3.w 
  StructureUnion 
    bstrVal.l 
  EndStructureUnion 
EndStructure 

Interface ISpBaseStream Extends IDispatch 
  get_Format(a) 
  putref_Format(a) 
  Read(a,b,c) 
  Write(a,b,c,d,e) 
  Seek(a,b,c,d,e,f) 
EndInterface 

Interface ISpMemoryStream Extends ISpBaseStream 
  SetData(a,b,c,d) 
  GetData(a) 
EndInterface 

Interface ISpVoice Extends IDispatch 
  get_Status(a) 
  get_Voice(a) 
  putref_Voice(a) 
  get_AudioOutput(a) 
  putref_AudioOutput(a) 
  get_AudioOutputStream(a) 
  putref_AudioOutputStream(a) 
  get_Rate(a) 
  put_Rate(a) 
  get_Volume(a) 
  put_Volume(a) 
  put_AllowAudioOutputFormatChangesOnNextSet(a) 
  get_AllowAudioOutputFormatChangesOnNextSet(a) 
  get_EventInterests(a) 
  put_EventInterests(a) 
  put_Priority(a) 
  get_Priority(a) 
  put_AlertBoundary(a) 
  get_AlertBoundary(a) 
  put_SynchronousSpeakTimeout(a) 
  get_SynchronousSpeakTimeout(a) 
  Speak(a,b,c) 
  SpeakStream(a,b,c) 
  Pause() 
  Resume() 
  Skip(a,b,c) 
  GetVoices(a,b,c) 
  GetAudioOutputs(a,b,c) 
  WaitUntilDone(a,b) 
  SpeakCompleteEvent(a) 
  IsUISupported(a,b,c) 
  DisplayUI(a,b,c,d) 
EndInterface 



Procedure SAPI5Init() ; This is just the creation of the voice object.
  Shared SAPI5Voice.ISpVoice 
  CoInitialize_(0) 
  If CoCreateInstance_(?CLSID_SpVoice, 0, #CLSCTX_ALL, ?IID_ISpVoice, @SAPI5Voice) = 0 
    ProcedureReturn 1
  Else 
    ProcedureReturn 0 
  EndIf 
EndProcedure 

Procedure SAPI5MemSpeak(text.s) 
  Shared SAPI5Voice.ISpVoice 
  CoCreateInstance_(?CLSID_SpMemoryStream, 0, #CLSCTX_ALL, ?IID_ISpMemoryStream, @SAPI5Memory.ISpMemoryStream) ; This is the creation of the memory object
  text="<voice required="+Chr(34)+"Name=Microsoft Sam"+Chr(34)+"/>"+text ; let's set Sam as the voice 
  SAPI5Voice\putref_AudioOutputStream(SAPI5Memory) ; we want to send the speech to memory 
  textlength = Len(text)*2+1 ; just convert ansi string to widechar 
  *textbuff = AllocateMemory(textlength) 
  MultiByteToWideChar_(#CP_ACP ,0,text,-1,*textbuff,textlength)
  SAPI5Voice\Speak(*textbuff,8,0) ; speak to memory (this is very fast) 
  FreeMemory(*textbuff) ; free the text buffer 
  SAPI5Memory\Seek(0,0,0,0,2,@posi.VARI) ; get the memory buffer length 
  membufflength=posi\bstrVal 
  SAPI5Memory\GetData(@mem.VARI) ; get the memory content 
  *audiobuff=AllocateMemory(membufflength+44) ; create an audio buffer 
  
  PokeL(*audiobuff,$46464952) ; write the header 
  PokeL(*audiobuff+4,membufflength+36) 
  PokeL(*audiobuff+8,$45564157) 
  PokeL(*audiobuff+12,$20746D66) 
  PokeL(*audiobuff+16,16)  
  PokeW(*audiobuff+20,1) 
  PokeW(*audiobuff+22,1) 
  PokeL(*audiobuff+24,22050) 
  PokeL(*audiobuff+28,44100) 
  PokeW(*audiobuff+32,2) 
  PokeW(*audiobuff+34,16) 
  PokeL(*audiobuff+36,$61746164) 
  PokeL(*audiobuff+40,membufflength) 
  CopyMemory(mem\bstrVal+18, *audiobuff+44, membufflength-18) ; and write the data 
  
  InitSound() ; now we can initalize the sound support 
  CatchSound(0,*audiobuff,membufflength) ; load the audio buffer 
  PlaySound(0) ; and play it 
  Delay(1000*membufflength/44100) ; wait while the sound is playing 
  
  FreeSound(0) ; very self explained 
  FreeMemory(*audiobuff) ; this too 
  SAPI5Memory\Release()
EndProcedure 

Procedure SAPI5End() 
  Shared SAPI5Voice.ISpVoice 
  
  SAPI5Voice\Release() ; free resources 
  CoUninitialize_() 
EndProcedure 

DataSection 
CLSID_SpVoice: 
Data.l $96749377 
Data.w $3391,$11D2 
Data.b $9E,$E3,$00,$C0,$4F,$79,$73,$96 
IID_ISpVoice: 
Data.l $269316D8 
Data.w $57BD,$11D2 
Data.b $9E,$EE,$00,$C0,$4F,$79,$73,$96 
CLSID_SpMemoryStream: 
Data.l $5FB7EF7D 
Data.w $DFF4,$468A 
Data.b $B6,$B7,$2F,$CB,$D1,$88,$F9,$94 
IID_ISpMemoryStream: 
Data.l $EEB14B68 
Data.w $808B,$4ABE 
Data.b $A5,$EA,$B5,$1D,$A7,$58,$80,$08 
EndDataSection 

;/ Now we can test if everything is OK 

If SAPI5Init() 
  SAPI5MemSpeak("Hello world!") 
  SAPI5MemSpeak("I'm speaking from memory!") 
  SAPI5MemSpeak("Ciao!") 
  SAPI5End() 
Else 
  MessageRequester("Error!", "Unable to initialize SAPI 5 support.", #MB_OK|#MB_ICONERROR) 
EndIf 
End 
;/ That's all folks!
Esteban1
Esteban1
User
User
Posts: 37
Joined: Sat Jul 16, 2005 4:39 pm
Location: Uruguay

Post by Esteban1 »

to va!n:

If you are looking for an echo, reverb, or something like that you can substitute:

Code: Select all

CopyMemory(mem\bstrVal+18, *audiobuff+44, membufflength-18)
whith:

Code: Select all

  For i=18 To membufflength-8838 Step 2; let's make an echo effect
    basesound=mem\bstrVal+i
    echosound1=basesound+4410
    echosound2=echosound1+4410
    PokeW(*audiobuff+26+i,PeekW(basesound)>>1+PeekW(echosound1)>>2+PeekW(echosound2)>>2)
  Next
or for a deeper effect:

Code: Select all

  For i=18 To membufflength-18 Step 2; let's make deeper echo effect
    basesound=mem\bstrVal+i
    echosound1=basesound-8820
    If echosound1<mem\bstrVal+18:echosound1=mem\bstrVal+18:EndIf
    echosound2=echosound1-8820
    If echosound2<mem\bstrVal+18:echosound2=mem\bstrVal+18:EndIf
    PokeW(*audiobuff+26+i,PeekW(basesound)>>1+PeekW(echosound1)>>2+PeekW(echosound2)>>2)
  Next
You can play adding more "echosounds" to make a reverb effect, or changing the gap between them (4410 or 8820 in this case). There's no need of complicated DirectSound effects because we are creating the echo (or whatever you want/need) and filling the audio buffer at the same time.

Just take a look to the amount of coding is needed to implement the same kind of effect via DirectSound FX:

http://forums.purebasic.com/english/viewtopic.php?t=11962

DirectX is a nightmare (in my very own opinion).

Esteban1
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

Thanks a lot Esteban1 for all your help and posting the whole source and additional routines for making an small effect... i found same link yesterday and tried to implent the the echo effect by danilo, based on dx... but seems in my test source is something wrong... for the first, your codesnip with the deeper effect, is exactly what i looked for... very impressive! THANKS!! :D
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

Esteban1,

I read your posts with much interest ... you did a good job !

I don't know if something has been done concerning a possible SaveSound() procedure, but it sounds like just this one is missing now to make sense.

KRgrds
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
Esteban1
User
User
Posts: 37
Joined: Sat Jul 16, 2005 4:39 pm
Location: Uruguay

Post by Esteban1 »

To va!n:

Thank you very much for the compliments. I think the last posts should go to the Tips and Tricks instead of the Announcements forum. If you like you can put it there, somebody could find it useful.

To fweil:

PureTTS library was updated some time ago, take a look a this:

http://forums.purebasic.com/english/viewtopic.php?t=16034&start=21

Since that update you are able to output the speech to a .wav file, firing the events the same way as sending it to the soundcard (useful for supervising the convertion progress).

You can download the last release at:

http://geocities.com/esteban1uy/My_drive.html

Esteban1.
Esteban1
User
User
Posts: 37
Joined: Sat Jul 16, 2005 4:39 pm
Location: Uruguay

Post by Esteban1 »

To va!n;

I think I got it, now you can use those DMO FX with SAPI 5. Please test it.

Code: Select all

;/ Speaking from memory using SAPI 5 with FX
;/ By Esteban1 based on the great example
;/ of playing a sound buffer with DirectX 8 
;/ (Danilo and www.MasterCreating.de) 
;/ and apply DirectX effects on it. 
;/ (Zapman)
;/
;/ 08-20-2005 
#CLSCTX_INPROC_SERVER  = $1 
#CLSCTX_INPROC_HANDLER = $2 
#CLSCTX_LOCAL_SERVER   = $4 
#CLSCTX_REMOTE_SERVER  = $10 
#CLSCTX_ALL = (#CLSCTX_INPROC_SERVER|#CLSCTX_INPROC_HANDLER|#CLSCTX_LOCAL_SERVER|#CLSCTX_REMOTE_SERVER) 

#DSBCAPS_PRIMARYBUFFER  =$1
#DSBCAPS_LOCSOFTWARE    = $8 
#DSBCAPS_CTRLFX          = $200

#DSFX_LOCSOFTWARE       =$2
#DSBLOCK_ENTIREBUFFER   = $2 

Structure DSFXDesc 
  dwSize.l
  dwFlags.l
  guidDSFXClass.GUID
  *dwReserved1.l
  *dwReserved2.l
EndStructure

Structure WAVEFORMATEX
  wFormatTag.w       
  nChannels.w        
  nSamplesPerSec.l    
  nAvgBytesPerSec.l   
  nBlockAlign.w
  wBitsPerSample.w   
  cbSize.w
EndStructure 

Structure DSBUFFERDESC 
  dwSize.l 
  dwFlags.l 
  dwBufferBytes.l
  dwReserved.l
  *lpwfxFormat.WAVEFORMATEX
  guid3DAlgorithm.GUID
EndStructure 

Structure VARIANT ; if you have this structure already defined just comment it 
  vt.w 
  wReserved1.w 
  wReserved2.w 
  wReserved3.w 
  StructureUnion 
    bstrVal.l 
  EndStructureUnion 
EndStructure 

Interface ISpWaveFormatEx Extends IDispatch
  get_FormatTag(a)
  put_FormatTag(a)
  get_Channels(a)
  put_Channels(a)
  get_SamplesPerSec(a)
  put_SamplesPerSec(a)
  get_AvgBytesPerSec(a)
  put_AvgBytesPerSec(a)
  get_BlockAlign(a)
  put_BlockAlign(a)
  get_BitsPerSample(a)
  put_BitsPerSample(a)
  get_ExtraData(a)
  put_ExtraData(a,b,c,d)
EndInterface

Interface ISpAudioFormat Extends IDispatch
  get_Type(a)
  put_Type(a)
  get_Guid(a)
  put_Guid(a)
  GetWaveFormatEx(a)
  SetWaveFormatEx(a)
EndInterface

Interface ISpBaseStream Extends IDispatch 
  get_Format(a) 
  putref_Format(a) 
  Read(a,b,c) 
  Write(a,b,c,d,e) 
  Seek(a,b,c,d,e,f) 
EndInterface 

Interface ISpMemoryStream Extends ISpBaseStream 
  SetData(a,b,c,d) 
  GetData(a) 
EndInterface 

Interface ISpVoice Extends IDispatch 
  get_Status(a) 
  get_Voice(a) 
  putref_Voice(a) 
  get_AudioOutput(a) 
  putref_AudioOutput(a) 
  get_AudioOutputStream(a) 
  putref_AudioOutputStream(a) 
  get_Rate(a) 
  put_Rate(a) 
  get_Volume(a) 
  put_Volume(a) 
  put_AllowAudioOutputFormatChangesOnNextSet(a) 
  get_AllowAudioOutputFormatChangesOnNextSet(a) 
  get_EventInterests(a) 
  put_EventInterests(a) 
  put_Priority(a) 
  get_Priority(a) 
  put_AlertBoundary(a) 
  get_AlertBoundary(a) 
  put_SynchronousSpeakTimeout(a) 
  get_SynchronousSpeakTimeout(a) 
  Speak(a,b,c) 
  SpeakStream(a,b,c) 
  Pause() 
  Resume() 
  Skip(a,b,c) 
  GetVoices(a,b,c) 
  GetAudioOutputs(a,b,c) 
  WaitUntilDone(a,b) 
  SpeakCompleteEvent(a) 
  IsUISupported(a,b,c) 
  DisplayUI(a,b,c,d) 
EndInterface 

Procedure SAPI5Init() ; This is just the creation of the voice object.
  Shared SAPI5Voice.ISpVoice 
  CoInitialize_(0) 
  If CoCreateInstance_(?CLSID_SpVoice, 0, #CLSCTX_ALL, ?IID_ISpVoice, @SAPI5Voice) = 0 
    ProcedureReturn 1
  Else 
    ProcedureReturn 0 
  EndIf 
EndProcedure 

Procedure SAPI5SpeakFX(text.s) 
  Shared SAPI5Voice.ISpVoice 
  CoCreateInstance_(?CLSID_SpMemoryStream, 0, #CLSCTX_ALL, ?IID_ISpMemoryStream, @SAPI5Memory.ISpMemoryStream) ; This is the creation of the memory object
  text="<voice required="+Chr(34)+"Name=Microsoft Sam"+Chr(34)+"/>"+text ; let's set Sam as the voice 
  SAPI5Voice\putref_AudioOutputStream(SAPI5Memory) ; we want to send the speech to memory 
  textlength = Len(text)*2+1 ; just convert ansi string to widechar 
  *textbuff = AllocateMemory(textlength) 
  MultiByteToWideChar_(#CP_ACP ,0,text,-1,*textbuff,textlength)
  SAPI5Voice\Speak(*textbuff,8,0) ; speak to memory (this is very fast) 
  FreeMemory(*textbuff) ; free the text buffer 
  SAPI5Memory\Seek(0,0,0,0,2,@posi.VARIANT) ; get the memory buffer length 
  membufflength=posi\bstrVal 
  SAPI5Memory\GetData(@mem.VARIANT) ; get the memory content 
  
  If OpenLibrary(0,"DSOUND.DLL") ; now we go for DirectSound
    CallFunction(0,"DirectSoundCreate8",0,@DSObject.IDirectSound8,0) ; this is the creation of the DirectSound object
    CloseLibrary(0) ; free library
    DSObject\SetCooperativeLevel(WindowID(),1) ; now we set the cooperative level
    BufferDescriptor.DSBUFFERDESC ; and the structure for the primary buffer
    BufferDescriptor\dwSize = SizeOf(DSBUFFERDESC) 
    BufferDescriptor\dwFlags = #DSBCAPS_PRIMARYBUFFER  ; flag for primary buffer  
    DSObject\CreateSoundBuffer(@BufferDescriptor,@DSPBuffer.IDirectSoundBuffer,0) ; primary buffer creation
    SAPI5Memory\get_Format(@SAPI5AudioFormat.ISpAudioFormat) ; get the SpAudioFormat of SAPI5Memory
    SAPI5AudioFormat\GetWaveFormatEx(@SAPI5WaveFormatEx.ISpWaveFormatEx) ; and get the SpWaveFormatEx from SpAudioFormat
    BufferFormat.WAVEFORMATEX ; here we can put the format information
    SAPI5WaveFormatEx\get_FormatTag(@BufferFormat\wFormatTag) ; and put it
    SAPI5WaveFormatEx\get_Channels(@BufferFormat\nChannels)
    SAPI5WaveFormatEx\get_SamplesPerSec(@BufferFormat\nSamplesPerSec)
    SAPI5WaveFormatEx\get_AvgBytesPerSec(@BufferFormat\nAvgBytesPerSec)
    SAPI5WaveFormatEx\get_BlockAlign(@BufferFormat\nBlockAlign)
    SAPI5WaveFormatEx\get_BitsPerSample(@BufferFormat\wBitsPerSample)
    SAPI5WaveFormatEx\get_ExtraData(@BufferFormat\cbSize) 
    BufferDescriptor\dwFlags = #DSBCAPS_LOCSOFTWARE|#DSBCAPS_CTRLFX ; now the flags for secondary buffer
    BufferDescriptor\dwBufferBytes = membufflength-18 ; this is the length of the speech memory buffer
    BufferDescriptor\lpwfxFormat = @BufferFormat ; and its format 
    DSObject\CreateSoundBuffer(@BufferDescriptor,@DSSBuffer.IDirectSoundBuffer,0) ; now we can create the secondary buffer
    DSSBuffer\QueryInterface(?IID_DirectSoundBuffer8,@DSSBuffer8.IDirectSoundBuffer8) ; but we need the DirectSoundBuffer8 interface
    DSSBuffer\Release() ; we don't need this anymore

    DSSBuffer8\Lock(0,0,@lpvWrite,@dwLength,0,0,#DSBLOCK_ENTIREBUFFER) ; now we can start populating the buffer
    CopyMemory(mem\bstrVal+18, lpvWrite, membufflength-18) ; copy data from memory buffer to secondary buffer 
    DSSBuffer8\UnLock(lpvWrite,dwLength,0,0) ; ready
    SAPI5Memory\Release() ; not needed too
    FXDescriptor.DSFXDesc ; here comes the fx structure
    FXDescriptor\dwSize =SizeOf(DSFXDesc)
    FXDescriptor\dwFlags=#DSFX_LOCSOFTWARE
    ; here you set the FX you want, I used CLSID_DirectSoundFXEcho for example, you can find more at the DataSection
    CopyMemory(?CLSID_DirectSoundFXEcho,@FXDescriptor\guidDSFXClass,SizeOf(GUID))
    DSSBuffer8\SetFX(1,@FXDescriptor, @pdwResultCodes.l) ; now we can set the fx
    DSSBuffer8\Play(0,0,0) ; and finally play the buffer
    Repeat ; wait until play ends
      DSSBuffer8\GetStatus(@Status.l)
      Delay(10)
    Until Status=0
    
    DSSBuffer8\Stop() 
    DSSBuffer8\Release() ; and free resources
    DSPBuffer\Release() 
    DSObject\Release()
  Else
    MessageRequester("Attention!", "DirectSound support not found.", #MB_OK|#MB_ICONWARNING)
  EndIf 
EndProcedure 

Procedure SAPI5End() 
  Shared SAPI5Voice.ISpVoice 
  SAPI5Voice\Release() ; free resources
  CoUninitialize_() 
EndProcedure 

DataSection 
CLSID_SpVoice: 
Data.l $96749377 
Data.w $3391,$11D2 
Data.b $9E,$E3,$00,$C0,$4F,$79,$73,$96 
IID_ISpVoice: 
Data.l $269316D8 
Data.w $57BD,$11D2 
Data.b $9E,$EE,$00,$C0,$4F,$79,$73,$96 
CLSID_SpMemoryStream: 
Data.l $5FB7EF7D 
Data.w $DFF4,$468A 
Data.b $B6,$B7,$2F,$CB,$D1,$88,$F9,$94 
IID_ISpMemoryStream: 
Data.l $EEB14B68 
Data.w $808B,$4ABE 
Data.b $A5,$EA,$B5,$1D,$A7,$58,$80,$08 
IID_DirectSoundBuffer8:
Data.l $6825A449 
Data.w $7524,$4D82 
Data.b $92,$0F,$50,$E3,$6A,$B3,$AB,$1E 
CLSID_DirectSoundFXChorus: 
Data.l $EFE6629C
Data.w $81F7,$4281
Data.b $BD,$91,$C9,$D6,$4,$A9,$5A,$F6
CLSID_DirectSoundFXFlanger: 
Data.l $EFCA3D92
Data.w $DFD8,$4672
Data.b $A6,$3,$74,$20,$89,$4B,$AD,$98
CLSID_DirectSoundFXEcho: 
Data.l $EF3E932C
Data.w $D40B,$4F51
Data.b $8C,$CF,$3F,$98,$F1,$B2,$9D,$5D
CLSID_DirectSoundFXDistortion: 
Data.l $EF114C90
Data.w $CD1D,$484E
Data.b $96,$E5,$9,$CF,$AF,$91,$2A,$21
CLSID_DirectSoundFXCompressor: 
Data.l $EF011F79
Data.w $4000,$406D
Data.b $87,$AF,$BF,$FB,$3F,$C3,$9D,$57
CLSID_DirectSoundFXEqualization: 
Data.l $120CED89
Data.w $3BF4,$4173
Data.b $A1,$32,$3C,$B4,$6,$CF,$32,$31
CLSID_DirectSoundFXI3DL2Reverberation:
Data.l $EF985E71
Data.w $D5C7,$42D4
Data.b $BA,$4D,$2D,$7,$3E,$2E,$96,$F4
CLSID_DirectSoundFXWReverberation: 
Data.l $87FC0268
Data.w $9A55,$4360
Data.b $95,$AA,$0,$4A,$1D,$9D,$E2,$6C
EndDataSection


;/ Let's test it 
OpenWindow(0,0,0,200,200,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Speech DMO FX")
CreateGadgetList(WindowID())
ButtonGadget(0,80,80,40,40,"Speak")
If SAPI5Init() 
Else 
  MessageRequester("Error!", "Unable to initialize SAPI 5 support.", #MB_OK|#MB_ICONERROR) 
EndIf 

Repeat 
  Select WaitWindowEvent() 
    Case #PB_Event_CloseWindow 
      Quit = 1 
    Case #PB_Event_Gadget 
      Select EventGadgetID() 
        Case 0 
          SAPI5SpeakFX("Hello world!") 
          SAPI5SpeakFX("I'm using some effects.")
          SAPI5SpeakFX("Goodbye!")
      EndSelect 
  EndSelect 
Until Quit 
SAPI5End()
End
Regards

Esteban1
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

seems to work fine here.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Post by Dummy »

Esteban1 wrote:It seems that AND speech is based on some form of Festival, a speech synthesis that is not related in any way to SAPI. Just take a look to this:


http://cslu.cse.ogi.edu/tts/index.html
:shock:

Can you post a link to a compiled version of that thing? The wohle page is confusing me :(
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

Esteban1 wrote:To va!n;

I think I got it, now you can use those DMO FX with SAPI 5. Please test it.
Really awesome! Seems to works here without any problem.. i have tried all included FX´s and it works... :wink:
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Esteban1
User
User
Posts: 37
Joined: Sat Jul 16, 2005 4:39 pm
Location: Uruguay

Post by Esteban1 »

Dummy wrote:
:shock:

Can you post a link to a compiled version of that thing? The wohle page is confusing me :(
I'm afraid I don't know about those compiled versions, but all the sources are available in C++, so you can easily translate them to PureBasic (there are also many examples for doing that in this forum).

Luck

Esteban1
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Post by Dummy »

I mean a compiled version of THAT:
Esteban1 wrote:It seems that AND speech is based on some form of Festival, a speech synthesis that is not related in any way to SAPI. Just take a look to this:


http://cslu.cse.ogi.edu/tts/index.html
That wasn't translated to PB till now!
Esteban1
User
User
Posts: 37
Joined: Sat Jul 16, 2005 4:39 pm
Location: Uruguay

Post by Esteban1 »

to Dummy:

Once again, I don't know of any compiled version of THAT, but you have the opportunity to start a great new project translating it to PureBasic and then compiling it!

Luck

Esteban1
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Post by Dummy »

If I'd understand THAT I'd be able to start a project and do that...BUT I DON'T UNDERSTAND THE WHOLE THING!!!! It's just confusing me!
Esteban1
User
User
Posts: 37
Joined: Sat Jul 16, 2005 4:39 pm
Location: Uruguay

Post by Esteban1 »

Dummy wrote:If I'd understand THAT I'd be able to start a project and do that...BUT I DON'T UNDERSTAND THE WHOLE THING!!!! It's just confusing me!
Maybe you can contact THAT site webmaster and ask him for a more "friendly" version of the contents (I'm not related in any way to THAT, I've just referenced it).

Luck

Esteban1
Post Reply